Created
February 10, 2023 08:49
-
-
Save ennerf/2c3a66d68f2b247372a3a589b5340545 to your computer and use it in GitHub Desktop.
QuickBuffers 1.1.0 - Generated samples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by protocol buffer compiler. Do not edit! | |
package protos.test.quickbuf; | |
import java.io.IOException; | |
import protos.test.quickbuf.external.ImportEnum; | |
import protos.test.quickbuf.external.ImportMessage; | |
import us.hebi.quickbuf.FieldName; | |
import us.hebi.quickbuf.InvalidProtocolBufferException; | |
import us.hebi.quickbuf.JsonSink; | |
import us.hebi.quickbuf.JsonSource; | |
import us.hebi.quickbuf.MessageFactory; | |
import us.hebi.quickbuf.ProtoEnum; | |
import us.hebi.quickbuf.ProtoMessage; | |
import us.hebi.quickbuf.ProtoSink; | |
import us.hebi.quickbuf.ProtoSource; | |
import us.hebi.quickbuf.ProtoUtil; | |
import us.hebi.quickbuf.RepeatedByte; | |
@SuppressWarnings("hiding") | |
public final class ContainerMessage extends ProtoMessage<ContainerMessage> implements Cloneable { | |
private static final long serialVersionUID = 0L; | |
/** | |
* optional .quickbuf_unittest.ContainerMessage.NestedEnum optional_nested_enum = 2; | |
*/ | |
private int optionalNestedEnum; | |
/** | |
* optional .quickbuf_unittest.ForeignEnum optional_foreign_enum = 4; | |
*/ | |
private int optionalForeignEnum; | |
/** | |
* optional .quickbuf_unittest_import.ImportEnum optional_import_enum = 6; | |
*/ | |
private int optionalImportEnum; | |
/** | |
* optional .quickbuf_unittest.ContainerMessage.NestedMessage optional_nested_message = 1; | |
*/ | |
private final NestedMessage optionalNestedMessage = NestedMessage.newInstance(); | |
/** | |
* optional .quickbuf_unittest.ForeignMessage optional_foreign_message = 3; | |
*/ | |
private final ForeignMessage optionalForeignMessage = ForeignMessage.newInstance(); | |
/** | |
* optional .quickbuf_unittest_import.ImportMessage optional_import_message = 5; | |
*/ | |
private final ImportMessage optionalImportMessage = ImportMessage.newInstance(); | |
/** | |
* optional .quickbuf_unittest_import.ImportMessage.NestedImportMessage optional_nested_import_message = 7; | |
*/ | |
private final ImportMessage.NestedImportMessage optionalNestedImportMessage = ImportMessage.NestedImportMessage.newInstance(); | |
/** | |
* Stores unknown fields to enable message routing without a full definition. | |
*/ | |
private final RepeatedByte unknownBytes = RepeatedByte.newEmptyInstance(); | |
private ContainerMessage() { | |
} | |
public static ContainerMessage newInstance() { | |
return new ContainerMessage(); | |
} | |
@Override | |
public final RepeatedByte getUnknownBytes() { | |
return unknownBytes; | |
} | |
public boolean hasOptionalNestedEnum() { | |
return (bitField0_ & 0x00000001) != 0; | |
} | |
public ContainerMessage clearOptionalNestedEnum() { | |
bitField0_ &= ~0x00000001; | |
optionalNestedEnum = 0; | |
return this; | |
} | |
public NestedEnum getOptionalNestedEnum() { | |
return NestedEnum.forNumber(optionalNestedEnum); | |
} | |
/** | |
* Gets the value of the internal enum store. The result is | |
* equivalent to {@link ContainerMessage#getOptionalNestedEnum()}.getNumber(). | |
*/ | |
public int getOptionalNestedEnumValue() { | |
return optionalNestedEnum; | |
} | |
/** | |
* Sets the value of the internal enum store. This does not | |
* do any validity checks, so be sure to use appropriate value | |
* constants from {@link NestedEnum}. Setting an invalid value | |
* can cause {@link ContainerMessage#getOptionalNestedEnum()} to return null | |
*/ | |
public ContainerMessage setOptionalNestedEnumValue(final int value) { | |
bitField0_ |= 0x00000001; | |
optionalNestedEnum = value; | |
return this; | |
} | |
public ContainerMessage setOptionalNestedEnum(final NestedEnum value) { | |
bitField0_ |= 0x00000001; | |
optionalNestedEnum = value.getNumber(); | |
return this; | |
} | |
public boolean hasOptionalForeignEnum() { | |
return (bitField0_ & 0x00000002) != 0; | |
} | |
public ContainerMessage clearOptionalForeignEnum() { | |
bitField0_ &= ~0x00000002; | |
optionalForeignEnum = 0; | |
return this; | |
} | |
public ForeignEnum getOptionalForeignEnum() { | |
return ForeignEnum.forNumber(optionalForeignEnum); | |
} | |
/** | |
* Gets the value of the internal enum store. The result is | |
* equivalent to {@link ContainerMessage#getOptionalForeignEnum()}.getNumber(). | |
*/ | |
public int getOptionalForeignEnumValue() { | |
return optionalForeignEnum; | |
} | |
/** | |
* Sets the value of the internal enum store. This does not | |
* do any validity checks, so be sure to use appropriate value | |
* constants from {@link ForeignEnum}. Setting an invalid value | |
* can cause {@link ContainerMessage#getOptionalForeignEnum()} to return null | |
*/ | |
public ContainerMessage setOptionalForeignEnumValue(final int value) { | |
bitField0_ |= 0x00000002; | |
optionalForeignEnum = value; | |
return this; | |
} | |
public ContainerMessage setOptionalForeignEnum(final ForeignEnum value) { | |
bitField0_ |= 0x00000002; | |
optionalForeignEnum = value.getNumber(); | |
return this; | |
} | |
public boolean hasOptionalImportEnum() { | |
return (bitField0_ & 0x00000004) != 0; | |
} | |
public ContainerMessage clearOptionalImportEnum() { | |
bitField0_ &= ~0x00000004; | |
optionalImportEnum = 0; | |
return this; | |
} | |
public ImportEnum getOptionalImportEnum() { | |
return ImportEnum.forNumber(optionalImportEnum); | |
} | |
/** | |
* Gets the value of the internal enum store. The result is | |
* equivalent to {@link ContainerMessage#getOptionalImportEnum()}.getNumber(). | |
*/ | |
public int getOptionalImportEnumValue() { | |
return optionalImportEnum; | |
} | |
/** | |
* Sets the value of the internal enum store. This does not | |
* do any validity checks, so be sure to use appropriate value | |
* constants from {@link ImportEnum}. Setting an invalid value | |
* can cause {@link ContainerMessage#getOptionalImportEnum()} to return null | |
*/ | |
public ContainerMessage setOptionalImportEnumValue(final int value) { | |
bitField0_ |= 0x00000004; | |
optionalImportEnum = value; | |
return this; | |
} | |
public ContainerMessage setOptionalImportEnum(final ImportEnum value) { | |
bitField0_ |= 0x00000004; | |
optionalImportEnum = value.getNumber(); | |
return this; | |
} | |
public boolean hasOptionalNestedMessage() { | |
return (bitField0_ & 0x00000008) != 0; | |
} | |
public ContainerMessage clearOptionalNestedMessage() { | |
bitField0_ &= ~0x00000008; | |
optionalNestedMessage.clear(); | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableOptionalNestedMessage()} if you want to modify it. | |
*/ | |
public NestedMessage getOptionalNestedMessage() { | |
return optionalNestedMessage; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public NestedMessage getMutableOptionalNestedMessage() { | |
bitField0_ |= 0x00000008; | |
return optionalNestedMessage; | |
} | |
public ContainerMessage setOptionalNestedMessage(final NestedMessage value) { | |
bitField0_ |= 0x00000008; | |
optionalNestedMessage.copyFrom(value); | |
return this; | |
} | |
public boolean hasOptionalForeignMessage() { | |
return (bitField0_ & 0x00000010) != 0; | |
} | |
public ContainerMessage clearOptionalForeignMessage() { | |
bitField0_ &= ~0x00000010; | |
optionalForeignMessage.clear(); | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableOptionalForeignMessage()} if you want to modify it. | |
*/ | |
public ForeignMessage getOptionalForeignMessage() { | |
return optionalForeignMessage; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public ForeignMessage getMutableOptionalForeignMessage() { | |
bitField0_ |= 0x00000010; | |
return optionalForeignMessage; | |
} | |
public ContainerMessage setOptionalForeignMessage(final ForeignMessage value) { | |
bitField0_ |= 0x00000010; | |
optionalForeignMessage.copyFrom(value); | |
return this; | |
} | |
public boolean hasOptionalImportMessage() { | |
return (bitField0_ & 0x00000020) != 0; | |
} | |
public ContainerMessage clearOptionalImportMessage() { | |
bitField0_ &= ~0x00000020; | |
optionalImportMessage.clear(); | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableOptionalImportMessage()} if you want to modify it. | |
*/ | |
public ImportMessage getOptionalImportMessage() { | |
return optionalImportMessage; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public ImportMessage getMutableOptionalImportMessage() { | |
bitField0_ |= 0x00000020; | |
return optionalImportMessage; | |
} | |
public ContainerMessage setOptionalImportMessage(final ImportMessage value) { | |
bitField0_ |= 0x00000020; | |
optionalImportMessage.copyFrom(value); | |
return this; | |
} | |
public boolean hasOptionalNestedImportMessage() { | |
return (bitField0_ & 0x00000040) != 0; | |
} | |
public ContainerMessage clearOptionalNestedImportMessage() { | |
bitField0_ &= ~0x00000040; | |
optionalNestedImportMessage.clear(); | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableOptionalNestedImportMessage()} if you want to modify it. | |
*/ | |
public ImportMessage.NestedImportMessage getOptionalNestedImportMessage() { | |
return optionalNestedImportMessage; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public ImportMessage.NestedImportMessage getMutableOptionalNestedImportMessage() { | |
bitField0_ |= 0x00000040; | |
return optionalNestedImportMessage; | |
} | |
public ContainerMessage setOptionalNestedImportMessage( | |
final ImportMessage.NestedImportMessage value) { | |
bitField0_ |= 0x00000040; | |
optionalNestedImportMessage.copyFrom(value); | |
return this; | |
} | |
@Override | |
public ContainerMessage copyFrom(final ContainerMessage other) { | |
cachedSize = other.cachedSize; | |
if ((bitField0_ | other.bitField0_) != 0) { | |
bitField0_ = other.bitField0_; | |
optionalNestedEnum = other.optionalNestedEnum; | |
optionalForeignEnum = other.optionalForeignEnum; | |
optionalImportEnum = other.optionalImportEnum; | |
optionalNestedMessage.copyFrom(other.optionalNestedMessage); | |
optionalForeignMessage.copyFrom(other.optionalForeignMessage); | |
optionalImportMessage.copyFrom(other.optionalImportMessage); | |
optionalNestedImportMessage.copyFrom(other.optionalNestedImportMessage); | |
} | |
unknownBytes.copyFrom(other.unknownBytes); | |
return this; | |
} | |
@Override | |
public ContainerMessage mergeFrom(final ContainerMessage other) { | |
if (other.isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
if (other.hasOptionalNestedEnum()) { | |
setOptionalNestedEnumValue(other.optionalNestedEnum); | |
} | |
if (other.hasOptionalForeignEnum()) { | |
setOptionalForeignEnumValue(other.optionalForeignEnum); | |
} | |
if (other.hasOptionalImportEnum()) { | |
setOptionalImportEnumValue(other.optionalImportEnum); | |
} | |
if (other.hasOptionalNestedMessage()) { | |
getMutableOptionalNestedMessage().mergeFrom(other.optionalNestedMessage); | |
} | |
if (other.hasOptionalForeignMessage()) { | |
getMutableOptionalForeignMessage().mergeFrom(other.optionalForeignMessage); | |
} | |
if (other.hasOptionalImportMessage()) { | |
getMutableOptionalImportMessage().mergeFrom(other.optionalImportMessage); | |
} | |
if (other.hasOptionalNestedImportMessage()) { | |
getMutableOptionalNestedImportMessage().mergeFrom(other.optionalNestedImportMessage); | |
} | |
if (other.unknownBytes.length() > 0) { | |
unknownBytes.addAll(other.unknownBytes); | |
} | |
return this; | |
} | |
@Override | |
public ContainerMessage clear() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
optionalNestedEnum = 0; | |
optionalForeignEnum = 0; | |
optionalImportEnum = 0; | |
optionalNestedMessage.clear(); | |
optionalForeignMessage.clear(); | |
optionalImportMessage.clear(); | |
optionalNestedImportMessage.clear(); | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public ContainerMessage clearQuick() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
optionalNestedMessage.clearQuick(); | |
optionalForeignMessage.clearQuick(); | |
optionalImportMessage.clearQuick(); | |
optionalNestedImportMessage.clearQuick(); | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public boolean equals(Object o) { | |
if (o == this) { | |
return true; | |
} | |
if (!(o instanceof ContainerMessage)) { | |
return false; | |
} | |
ContainerMessage other = (ContainerMessage) o; | |
return bitField0_ == other.bitField0_ | |
&& (!hasOptionalNestedEnum() || optionalNestedEnum == other.optionalNestedEnum) | |
&& (!hasOptionalForeignEnum() || optionalForeignEnum == other.optionalForeignEnum) | |
&& (!hasOptionalImportEnum() || optionalImportEnum == other.optionalImportEnum) | |
&& (!hasOptionalNestedMessage() || optionalNestedMessage.equals(other.optionalNestedMessage)) | |
&& (!hasOptionalForeignMessage() || optionalForeignMessage.equals(other.optionalForeignMessage)) | |
&& (!hasOptionalImportMessage() || optionalImportMessage.equals(other.optionalImportMessage)) | |
&& (!hasOptionalNestedImportMessage() || optionalNestedImportMessage.equals(other.optionalNestedImportMessage)); | |
} | |
@Override | |
public void writeTo(final ProtoSink output) throws IOException { | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeRawByte((byte) 16); | |
output.writeEnumNoTag(optionalNestedEnum); | |
} | |
if ((bitField0_ & 0x00000002) != 0) { | |
output.writeRawByte((byte) 32); | |
output.writeEnumNoTag(optionalForeignEnum); | |
} | |
if ((bitField0_ & 0x00000004) != 0) { | |
output.writeRawByte((byte) 48); | |
output.writeEnumNoTag(optionalImportEnum); | |
} | |
if ((bitField0_ & 0x00000008) != 0) { | |
output.writeRawByte((byte) 10); | |
output.writeMessageNoTag(optionalNestedMessage); | |
} | |
if ((bitField0_ & 0x00000010) != 0) { | |
output.writeRawByte((byte) 26); | |
output.writeMessageNoTag(optionalForeignMessage); | |
} | |
if ((bitField0_ & 0x00000020) != 0) { | |
output.writeRawByte((byte) 42); | |
output.writeMessageNoTag(optionalImportMessage); | |
} | |
if ((bitField0_ & 0x00000040) != 0) { | |
output.writeRawByte((byte) 58); | |
output.writeMessageNoTag(optionalNestedImportMessage); | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeRawBytes(unknownBytes); | |
} | |
} | |
@Override | |
protected int computeSerializedSize() { | |
int size = 0; | |
if ((bitField0_ & 0x00000001) != 0) { | |
size += 1 + ProtoSink.computeEnumSizeNoTag(optionalNestedEnum); | |
} | |
if ((bitField0_ & 0x00000002) != 0) { | |
size += 1 + ProtoSink.computeEnumSizeNoTag(optionalForeignEnum); | |
} | |
if ((bitField0_ & 0x00000004) != 0) { | |
size += 1 + ProtoSink.computeEnumSizeNoTag(optionalImportEnum); | |
} | |
if ((bitField0_ & 0x00000008) != 0) { | |
size += 1 + ProtoSink.computeMessageSizeNoTag(optionalNestedMessage); | |
} | |
if ((bitField0_ & 0x00000010) != 0) { | |
size += 1 + ProtoSink.computeMessageSizeNoTag(optionalForeignMessage); | |
} | |
if ((bitField0_ & 0x00000020) != 0) { | |
size += 1 + ProtoSink.computeMessageSizeNoTag(optionalImportMessage); | |
} | |
if ((bitField0_ & 0x00000040) != 0) { | |
size += 1 + ProtoSink.computeMessageSizeNoTag(optionalNestedImportMessage); | |
} | |
size += unknownBytes.length(); | |
return size; | |
} | |
@Override | |
public ContainerMessage mergeFrom(final ProtoSource input) throws IOException { | |
// Enabled Fall-Through Optimization (QuickBuffers) | |
int tag = input.readTag(); | |
while (true) { | |
switch (tag) { | |
case 16: { | |
final int value = input.readInt32(); | |
if (NestedEnum.forNumber(value) != null) { | |
optionalNestedEnum = value; | |
bitField0_ |= 0x00000001; | |
} else { | |
input.skipEnum(tag, value, unknownBytes); | |
} | |
tag = input.readTag(); | |
if (tag != 32) { | |
break; | |
} | |
} | |
case 32: { | |
final int value = input.readInt32(); | |
if (ForeignEnum.forNumber(value) != null) { | |
optionalForeignEnum = value; | |
bitField0_ |= 0x00000002; | |
} else { | |
input.skipEnum(tag, value, unknownBytes); | |
} | |
tag = input.readTag(); | |
if (tag != 48) { | |
break; | |
} | |
} | |
case 48: { | |
final int value = input.readInt32(); | |
if (ImportEnum.forNumber(value) != null) { | |
optionalImportEnum = value; | |
bitField0_ |= 0x00000004; | |
} else { | |
input.skipEnum(tag, value, unknownBytes); | |
} | |
tag = input.readTag(); | |
if (tag != 10) { | |
break; | |
} | |
} | |
case 10: { | |
input.readMessage(optionalNestedMessage); | |
bitField0_ |= 0x00000008; | |
tag = input.readTag(); | |
if (tag != 26) { | |
break; | |
} | |
} | |
case 26: { | |
input.readMessage(optionalForeignMessage); | |
bitField0_ |= 0x00000010; | |
tag = input.readTag(); | |
if (tag != 42) { | |
break; | |
} | |
} | |
case 42: { | |
input.readMessage(optionalImportMessage); | |
bitField0_ |= 0x00000020; | |
tag = input.readTag(); | |
if (tag != 58) { | |
break; | |
} | |
} | |
case 58: { | |
input.readMessage(optionalNestedImportMessage); | |
bitField0_ |= 0x00000040; | |
tag = input.readTag(); | |
if (tag != 0) { | |
break; | |
} | |
} | |
case 0: { | |
return this; | |
} | |
default: { | |
if (!input.skipField(tag, unknownBytes)) { | |
return this; | |
} | |
tag = input.readTag(); | |
break; | |
} | |
} | |
} | |
} | |
@Override | |
public void writeTo(final JsonSink output) throws IOException { | |
output.beginObject(); | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeEnum(FieldNames.optionalNestedEnum, optionalNestedEnum, NestedEnum.converter()); | |
} | |
if ((bitField0_ & 0x00000002) != 0) { | |
output.writeEnum(FieldNames.optionalForeignEnum, optionalForeignEnum, ForeignEnum.converter()); | |
} | |
if ((bitField0_ & 0x00000004) != 0) { | |
output.writeEnum(FieldNames.optionalImportEnum, optionalImportEnum, ImportEnum.converter()); | |
} | |
if ((bitField0_ & 0x00000008) != 0) { | |
output.writeMessage(FieldNames.optionalNestedMessage, optionalNestedMessage); | |
} | |
if ((bitField0_ & 0x00000010) != 0) { | |
output.writeMessage(FieldNames.optionalForeignMessage, optionalForeignMessage); | |
} | |
if ((bitField0_ & 0x00000020) != 0) { | |
output.writeMessage(FieldNames.optionalImportMessage, optionalImportMessage); | |
} | |
if ((bitField0_ & 0x00000040) != 0) { | |
output.writeMessage(FieldNames.optionalNestedImportMessage, optionalNestedImportMessage); | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeBytes(ProtoMessage.unknownBytesFieldName, unknownBytes); | |
} | |
output.endObject(); | |
} | |
@Override | |
public ContainerMessage mergeFrom(final JsonSource input) throws IOException { | |
if (!input.beginObject()) { | |
return this; | |
} | |
while (!input.isAtEnd()) { | |
switch (input.readFieldHash()) { | |
case -20871656: | |
case -1574336278: { | |
if (input.isAtField(FieldNames.optionalNestedEnum)) { | |
if (!input.trySkipNullValue()) { | |
final ProtoEnum value = input.readEnum(NestedEnum.converter()); | |
if (value != null) { | |
optionalNestedEnum = value.getNumber(); | |
bitField0_ |= 0x00000001; | |
} else { | |
input.skipUnknownEnumValue(); | |
} | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -308772747: | |
case -376124405: { | |
if (input.isAtField(FieldNames.optionalForeignEnum)) { | |
if (!input.trySkipNullValue()) { | |
final ProtoEnum value = input.readEnum(ForeignEnum.converter()); | |
if (value != null) { | |
optionalForeignEnum = value.getNumber(); | |
bitField0_ |= 0x00000002; | |
} else { | |
input.skipUnknownEnumValue(); | |
} | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1302097466: | |
case 1657336572: { | |
if (input.isAtField(FieldNames.optionalImportEnum)) { | |
if (!input.trySkipNullValue()) { | |
final ProtoEnum value = input.readEnum(ImportEnum.converter()); | |
if (value != null) { | |
optionalImportEnum = value.getNumber(); | |
bitField0_ |= 0x00000004; | |
} else { | |
input.skipUnknownEnumValue(); | |
} | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -766385264: | |
case -1758324866: { | |
if (input.isAtField(FieldNames.optionalNestedMessage)) { | |
if (!input.trySkipNullValue()) { | |
input.readMessage(optionalNestedMessage); | |
bitField0_ |= 0x00000008; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -578097133: | |
case -1301613379: { | |
if (input.isAtField(FieldNames.optionalForeignMessage)) { | |
if (!input.trySkipNullValue()) { | |
input.readMessage(optionalForeignMessage); | |
bitField0_ |= 0x00000010; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -390131422: | |
case 1315609644: { | |
if (input.isAtField(FieldNames.optionalImportMessage)) { | |
if (!input.trySkipNullValue()) { | |
input.readMessage(optionalImportMessage); | |
bitField0_ |= 0x00000020; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -913110677: | |
case -1268676074: { | |
if (input.isAtField(FieldNames.optionalNestedImportMessage)) { | |
if (!input.trySkipNullValue()) { | |
input.readMessage(optionalNestedImportMessage); | |
bitField0_ |= 0x00000040; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1345895871: | |
case 2036068406: { | |
if (input.isAtField(ProtoMessage.unknownBytesFieldName)) { | |
mergeFrom(input.readBytesAsSource()); | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
default: { | |
input.skipUnknownField(); | |
break; | |
} | |
} | |
} | |
input.endObject(); | |
return this; | |
} | |
@Override | |
public ContainerMessage clone() { | |
return new ContainerMessage().copyFrom(this); | |
} | |
public boolean isEmpty() { | |
return ((bitField0_) == 0); | |
} | |
public static ContainerMessage parseFrom(final byte[] data) throws | |
InvalidProtocolBufferException { | |
return ProtoMessage.mergeFrom(new ContainerMessage(), data).checkInitialized(); | |
} | |
public static ContainerMessage parseFrom(final ProtoSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new ContainerMessage(), input).checkInitialized(); | |
} | |
public static ContainerMessage parseFrom(final JsonSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new ContainerMessage(), input).checkInitialized(); | |
} | |
public static MessageFactory<ContainerMessage> getFactory() { | |
return ContainerMessageFactory.INSTANCE; | |
} | |
public enum NestedEnum implements ProtoEnum { | |
FOO("FOO", 1), | |
BAR("BAR", 2), | |
BAZ("BAZ", 100); | |
public static final int FOO_VALUE = 1; | |
public static final int BAR_VALUE = 2; | |
public static final int BAZ_VALUE = 100; | |
private final String name; | |
private final int number; | |
private NestedEnum(String name, int number) { | |
this.name = name; | |
this.number = number; | |
} | |
@Override | |
public String getName() { | |
return name; | |
} | |
@Override | |
public int getNumber() { | |
return number; | |
} | |
public static NestedEnumConverter converter() { | |
return NestedEnumConverter.INSTANCE; | |
} | |
public static NestedEnum forNumber(int value) { | |
return NestedEnumConverter.INSTANCE.forNumber(value); | |
} | |
public static NestedEnum forNumberOr(int number, NestedEnum other) { | |
NestedEnum value = forNumber(number); | |
return value == null ? other : value; | |
} | |
enum NestedEnumConverter implements ProtoEnum.EnumConverter<NestedEnum> { | |
INSTANCE; | |
@Override | |
public final NestedEnum forNumber(final int value) { | |
switch(value) { | |
case 1: return FOO; | |
case 2: return BAR; | |
case 100: return BAZ; | |
default: return null; | |
} | |
} | |
@Override | |
public final NestedEnum forName(final CharSequence value) { | |
if (value.length() == 3) { | |
if (ProtoUtil.isEqual("FOO", value)) { | |
return FOO; | |
} | |
if (ProtoUtil.isEqual("BAR", value)) { | |
return BAR; | |
} | |
if (ProtoUtil.isEqual("BAZ", value)) { | |
return BAZ; | |
} | |
} | |
return null; | |
} | |
} | |
} | |
public static final class NestedMessage extends ProtoMessage<NestedMessage> implements Cloneable { | |
private static final long serialVersionUID = 0L; | |
/** | |
* optional int32 bb = 1; | |
*/ | |
private int bb; | |
/** | |
* Stores unknown fields to enable message routing without a full definition. | |
*/ | |
private final RepeatedByte unknownBytes = RepeatedByte.newEmptyInstance(); | |
private NestedMessage() { | |
} | |
public static NestedMessage newInstance() { | |
return new NestedMessage(); | |
} | |
@Override | |
public final RepeatedByte getUnknownBytes() { | |
return unknownBytes; | |
} | |
public boolean hasBb() { | |
return (bitField0_ & 0x00000001) != 0; | |
} | |
public NestedMessage clearBb() { | |
bitField0_ &= ~0x00000001; | |
bb = 0; | |
return this; | |
} | |
public int getBb() { | |
return bb; | |
} | |
public NestedMessage setBb(final int value) { | |
bitField0_ |= 0x00000001; | |
bb = value; | |
return this; | |
} | |
@Override | |
public NestedMessage copyFrom(final NestedMessage other) { | |
cachedSize = other.cachedSize; | |
if ((bitField0_ | other.bitField0_) != 0) { | |
bitField0_ = other.bitField0_; | |
bb = other.bb; | |
} | |
unknownBytes.copyFrom(other.unknownBytes); | |
return this; | |
} | |
@Override | |
public NestedMessage mergeFrom(final NestedMessage other) { | |
if (other.isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
if (other.hasBb()) { | |
setBb(other.bb); | |
} | |
if (other.unknownBytes.length() > 0) { | |
unknownBytes.addAll(other.unknownBytes); | |
} | |
return this; | |
} | |
@Override | |
public NestedMessage clear() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
bb = 0; | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public NestedMessage clearQuick() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public boolean equals(Object o) { | |
if (o == this) { | |
return true; | |
} | |
if (!(o instanceof NestedMessage)) { | |
return false; | |
} | |
NestedMessage other = (NestedMessage) o; | |
return bitField0_ == other.bitField0_ | |
&& (!hasBb() || bb == other.bb); | |
} | |
@Override | |
public void writeTo(final ProtoSink output) throws IOException { | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeRawByte((byte) 8); | |
output.writeInt32NoTag(bb); | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeRawBytes(unknownBytes); | |
} | |
} | |
@Override | |
protected int computeSerializedSize() { | |
int size = 0; | |
if ((bitField0_ & 0x00000001) != 0) { | |
size += 1 + ProtoSink.computeInt32SizeNoTag(bb); | |
} | |
size += unknownBytes.length(); | |
return size; | |
} | |
@Override | |
public NestedMessage mergeFrom(final ProtoSource input) throws IOException { | |
// Enabled Fall-Through Optimization (QuickBuffers) | |
int tag = input.readTag(); | |
while (true) { | |
switch (tag) { | |
case 8: { | |
bb = input.readInt32(); | |
bitField0_ |= 0x00000001; | |
tag = input.readTag(); | |
if (tag != 0) { | |
break; | |
} | |
} | |
case 0: { | |
return this; | |
} | |
default: { | |
if (!input.skipField(tag, unknownBytes)) { | |
return this; | |
} | |
tag = input.readTag(); | |
break; | |
} | |
} | |
} | |
} | |
@Override | |
public void writeTo(final JsonSink output) throws IOException { | |
output.beginObject(); | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeInt32(FieldNames.bb, bb); | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeBytes(ProtoMessage.unknownBytesFieldName, unknownBytes); | |
} | |
output.endObject(); | |
} | |
@Override | |
public NestedMessage mergeFrom(final JsonSource input) throws IOException { | |
if (!input.beginObject()) { | |
return this; | |
} | |
while (!input.isAtEnd()) { | |
switch (input.readFieldHash()) { | |
case 3136: { | |
if (input.isAtField(FieldNames.bb)) { | |
if (!input.trySkipNullValue()) { | |
bb = input.readInt32(); | |
bitField0_ |= 0x00000001; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1345895871: | |
case 2036068406: { | |
if (input.isAtField(ProtoMessage.unknownBytesFieldName)) { | |
mergeFrom(input.readBytesAsSource()); | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
default: { | |
input.skipUnknownField(); | |
break; | |
} | |
} | |
} | |
input.endObject(); | |
return this; | |
} | |
@Override | |
public NestedMessage clone() { | |
return new NestedMessage().copyFrom(this); | |
} | |
public boolean isEmpty() { | |
return ((bitField0_) == 0); | |
} | |
public static NestedMessage parseFrom(final byte[] data) throws | |
InvalidProtocolBufferException { | |
return ProtoMessage.mergeFrom(new NestedMessage(), data).checkInitialized(); | |
} | |
public static NestedMessage parseFrom(final ProtoSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new NestedMessage(), input).checkInitialized(); | |
} | |
public static NestedMessage parseFrom(final JsonSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new NestedMessage(), input).checkInitialized(); | |
} | |
public static MessageFactory<NestedMessage> getFactory() { | |
return NestedMessageFactory.INSTANCE; | |
} | |
private enum NestedMessageFactory implements MessageFactory<NestedMessage> { | |
INSTANCE; | |
@Override | |
public NestedMessage create() { | |
return NestedMessage.newInstance(); | |
} | |
} | |
/** | |
* Contains name constants used for serializing JSON | |
*/ | |
static class FieldNames { | |
static final FieldName bb = FieldName.forField("bb"); | |
} | |
} | |
private enum ContainerMessageFactory implements MessageFactory<ContainerMessage> { | |
INSTANCE; | |
@Override | |
public ContainerMessage create() { | |
return ContainerMessage.newInstance(); | |
} | |
} | |
/** | |
* Contains name constants used for serializing JSON | |
*/ | |
static class FieldNames { | |
static final FieldName optionalNestedEnum = FieldName.forField("optionalNestedEnum", "optional_nested_enum"); | |
static final FieldName optionalForeignEnum = FieldName.forField("optionalForeignEnum", "optional_foreign_enum"); | |
static final FieldName optionalImportEnum = FieldName.forField("optionalImportEnum", "optional_import_enum"); | |
static final FieldName optionalNestedMessage = FieldName.forField("optionalNestedMessage", "optional_nested_message"); | |
static final FieldName optionalForeignMessage = FieldName.forField("optionalForeignMessage", "optional_foreign_message"); | |
static final FieldName optionalImportMessage = FieldName.forField("optionalImportMessage", "optional_import_message"); | |
static final FieldName optionalNestedImportMessage = FieldName.forField("optionalNestedImportMessage", "optional_nested_import_message"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by protocol buffer compiler. Do not edit! | |
package protos.test.quickbuf; | |
import us.hebi.quickbuf.ProtoEnum; | |
import us.hebi.quickbuf.ProtoUtil; | |
public enum ForeignEnum implements ProtoEnum { | |
FOREIGN_FOO("FOREIGN_FOO", 4), | |
FOREIGN_BAR("FOREIGN_BAR", 5), | |
FOREIGN_BAZ("FOREIGN_BAZ", 6); | |
public static final int FOREIGN_FOO_VALUE = 4; | |
public static final int FOREIGN_BAR_VALUE = 5; | |
public static final int FOREIGN_BAZ_VALUE = 6; | |
private final String name; | |
private final int number; | |
private ForeignEnum(String name, int number) { | |
this.name = name; | |
this.number = number; | |
} | |
@Override | |
public String getName() { | |
return name; | |
} | |
@Override | |
public int getNumber() { | |
return number; | |
} | |
public static ForeignEnumConverter converter() { | |
return ForeignEnumConverter.INSTANCE; | |
} | |
public static ForeignEnum forNumber(int value) { | |
return ForeignEnumConverter.INSTANCE.forNumber(value); | |
} | |
public static ForeignEnum forNumberOr(int number, ForeignEnum other) { | |
ForeignEnum value = forNumber(number); | |
return value == null ? other : value; | |
} | |
enum ForeignEnumConverter implements ProtoEnum.EnumConverter<ForeignEnum> { | |
INSTANCE; | |
private static final ForeignEnum[] lookup = new ForeignEnum[7]; | |
static { | |
lookup[4] = FOREIGN_FOO; | |
lookup[5] = FOREIGN_BAR; | |
lookup[6] = FOREIGN_BAZ; | |
} | |
@Override | |
public final ForeignEnum forNumber(final int value) { | |
if (value >= 0 && value < lookup.length) { | |
return lookup[value]; | |
} | |
return null; | |
} | |
@Override | |
public final ForeignEnum forName(final CharSequence value) { | |
if (value.length() == 11) { | |
if (ProtoUtil.isEqual("FOREIGN_FOO", value)) { | |
return FOREIGN_FOO; | |
} | |
if (ProtoUtil.isEqual("FOREIGN_BAR", value)) { | |
return FOREIGN_BAR; | |
} | |
if (ProtoUtil.isEqual("FOREIGN_BAZ", value)) { | |
return FOREIGN_BAZ; | |
} | |
} | |
return null; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by protocol buffer compiler. Do not edit! | |
package protos.test.quickbuf; | |
import java.io.IOException; | |
import java.util.List; | |
import us.hebi.quickbuf.FieldName; | |
import us.hebi.quickbuf.InvalidProtocolBufferException; | |
import us.hebi.quickbuf.JsonSink; | |
import us.hebi.quickbuf.JsonSource; | |
import us.hebi.quickbuf.MessageFactory; | |
import us.hebi.quickbuf.ProtoEnum; | |
import us.hebi.quickbuf.ProtoMessage; | |
import us.hebi.quickbuf.ProtoSink; | |
import us.hebi.quickbuf.ProtoSource; | |
import us.hebi.quickbuf.ProtoUtil; | |
import us.hebi.quickbuf.RepeatedBoolean; | |
import us.hebi.quickbuf.RepeatedByte; | |
import us.hebi.quickbuf.RepeatedBytes; | |
import us.hebi.quickbuf.RepeatedDouble; | |
import us.hebi.quickbuf.RepeatedFloat; | |
import us.hebi.quickbuf.RepeatedInt; | |
import us.hebi.quickbuf.RepeatedLong; | |
import us.hebi.quickbuf.RepeatedMessage; | |
import us.hebi.quickbuf.RepeatedString; | |
import us.hebi.quickbuf.UninitializedMessageException; | |
import us.hebi.quickbuf.Utf8String; | |
public final class LazyTypes { | |
public static final class LazyMessage extends ProtoMessage<LazyMessage> implements Cloneable { | |
private static final long serialVersionUID = 0L; | |
/** | |
* optional .quickbuf_unittest.LazyMessage.NestedMessage optional_nested_message = 18; | |
*/ | |
private NestedMessage optionalNestedMessage = null; | |
/** | |
* optional .quickbuf_unittest.LazyMessage.OptionalGroup optionalgroup = 16; | |
*/ | |
private OptionalGroup optionalGroup = null; | |
/** | |
* optional bytes optional_bytes = 15; | |
*/ | |
private RepeatedByte optionalBytes = null; | |
/** | |
* optional string optional_string = 14; | |
*/ | |
private Utf8String optionalString = null; | |
/** | |
* repeated double repeated_double = 42; | |
*/ | |
private RepeatedDouble repeatedDouble = null; | |
/** | |
* repeated fixed64 repeated_fixed64 = 38; | |
*/ | |
private RepeatedLong repeatedFixed64 = null; | |
/** | |
* repeated sfixed64 repeated_sfixed64 = 40; | |
*/ | |
private RepeatedLong repeatedSfixed64 = null; | |
/** | |
* repeated int64 repeated_int64 = 32; | |
*/ | |
private RepeatedLong repeatedInt64 = null; | |
/** | |
* repeated uint64 repeated_uint64 = 34; | |
*/ | |
private RepeatedLong repeatedUint64 = null; | |
/** | |
* repeated sint64 repeated_sint64 = 36; | |
*/ | |
private RepeatedLong repeatedSint64 = null; | |
/** | |
* repeated float repeated_float = 41; | |
*/ | |
private RepeatedFloat repeatedFloat = null; | |
/** | |
* repeated fixed32 repeated_fixed32 = 37; | |
*/ | |
private RepeatedInt repeatedFixed32 = null; | |
/** | |
* repeated sfixed32 repeated_sfixed32 = 39; | |
*/ | |
private RepeatedInt repeatedSfixed32 = null; | |
/** | |
* repeated int32 repeated_int32 = 31; | |
*/ | |
private RepeatedInt repeatedInt32 = null; | |
/** | |
* repeated uint32 repeated_uint32 = 33; | |
*/ | |
private RepeatedInt repeatedUint32 = null; | |
/** | |
* repeated sint32 repeated_sint32 = 35; | |
*/ | |
private RepeatedInt repeatedSint32 = null; | |
/** | |
* repeated bool repeated_bool = 43; | |
*/ | |
private RepeatedBoolean repeatedBool = null; | |
/** | |
* repeated .quickbuf_unittest.LazyMessage.NestedMessage repeated_nested_message = 48; | |
*/ | |
private RepeatedMessage<NestedMessage> repeatedNestedMessage = null; | |
/** | |
* repeated .quickbuf_unittest.LazyMessage.RepeatedGroup repeatedgroup = 46; | |
*/ | |
private RepeatedMessage<RepeatedGroup> repeatedGroup = null; | |
/** | |
* repeated bytes repeated_bytes = 45; | |
*/ | |
private RepeatedBytes repeatedBytes = null; | |
/** | |
* repeated string repeated_string = 44; | |
*/ | |
private RepeatedString repeatedString = null; | |
/** | |
* Stores unknown fields to enable message routing without a full definition. | |
*/ | |
private final RepeatedByte unknownBytes = RepeatedByte.newEmptyInstance(); | |
private LazyMessage() { | |
} | |
public static LazyMessage newInstance() { | |
return new LazyMessage(); | |
} | |
@Override | |
public final RepeatedByte getUnknownBytes() { | |
return unknownBytes; | |
} | |
private void initOptionalNestedMessage() { | |
if (optionalNestedMessage == null) { | |
optionalNestedMessage = NestedMessage.newInstance(); | |
} | |
} | |
public boolean hasOptionalNestedMessage() { | |
return (bitField0_ & 0x00000001) != 0; | |
} | |
public LazyMessage clearOptionalNestedMessage() { | |
bitField0_ &= ~0x00000001; | |
if (optionalNestedMessage != null) { | |
optionalNestedMessage.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableOptionalNestedMessage()} if you want to modify it. | |
*/ | |
public NestedMessage getOptionalNestedMessage() { | |
if (!hasOptionalNestedMessage()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initOptionalNestedMessage(); | |
return optionalNestedMessage; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public NestedMessage getMutableOptionalNestedMessage() { | |
initOptionalNestedMessage(); | |
bitField0_ |= 0x00000001; | |
return optionalNestedMessage; | |
} | |
public LazyMessage setOptionalNestedMessage(final NestedMessage value) { | |
initOptionalNestedMessage(); | |
bitField0_ |= 0x00000001; | |
optionalNestedMessage.copyFrom(value); | |
return this; | |
} | |
private void initOptionalGroup() { | |
if (optionalGroup == null) { | |
optionalGroup = OptionalGroup.newInstance(); | |
} | |
} | |
public boolean hasOptionalGroup() { | |
return (bitField0_ & 0x00000002) != 0; | |
} | |
public LazyMessage clearOptionalGroup() { | |
bitField0_ &= ~0x00000002; | |
if (optionalGroup != null) { | |
optionalGroup.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableOptionalGroup()} if you want to modify it. | |
*/ | |
public OptionalGroup getOptionalGroup() { | |
if (!hasOptionalGroup()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initOptionalGroup(); | |
return optionalGroup; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public OptionalGroup getMutableOptionalGroup() { | |
initOptionalGroup(); | |
bitField0_ |= 0x00000002; | |
return optionalGroup; | |
} | |
public LazyMessage setOptionalGroup(final OptionalGroup value) { | |
initOptionalGroup(); | |
bitField0_ |= 0x00000002; | |
optionalGroup.copyFrom(value); | |
return this; | |
} | |
private void initOptionalBytes() { | |
if (optionalBytes == null) { | |
optionalBytes = RepeatedByte.newEmptyInstance(); | |
} | |
} | |
public boolean hasOptionalBytes() { | |
return (bitField0_ & 0x00000004) != 0; | |
} | |
public LazyMessage clearOptionalBytes() { | |
bitField0_ &= ~0x00000004; | |
if (optionalBytes != null) { | |
optionalBytes.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableOptionalBytes()} if you want to modify it. | |
*/ | |
public RepeatedByte getOptionalBytes() { | |
if (!hasOptionalBytes()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initOptionalBytes(); | |
return optionalBytes; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedByte getMutableOptionalBytes() { | |
initOptionalBytes(); | |
bitField0_ |= 0x00000004; | |
return optionalBytes; | |
} | |
public LazyMessage addOptionalBytes(final byte value) { | |
initOptionalBytes(); | |
bitField0_ |= 0x00000004; | |
optionalBytes.add(value); | |
return this; | |
} | |
public LazyMessage addAllOptionalBytes(final byte... values) { | |
initOptionalBytes(); | |
bitField0_ |= 0x00000004; | |
optionalBytes.addAll(values); | |
return this; | |
} | |
public LazyMessage setOptionalBytes(final byte... values) { | |
initOptionalBytes(); | |
bitField0_ |= 0x00000004; | |
optionalBytes.copyFrom(values); | |
return this; | |
} | |
private void initOptionalString() { | |
if (optionalString == null) { | |
optionalString = Utf8String.newEmptyInstance(); | |
} | |
} | |
public boolean hasOptionalString() { | |
return (bitField0_ & 0x00000008) != 0; | |
} | |
public LazyMessage clearOptionalString() { | |
bitField0_ &= ~0x00000008; | |
if (optionalString != null) { | |
optionalString.clear(); | |
} | |
return this; | |
} | |
public String getOptionalString() { | |
if (!hasOptionalString()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initOptionalString(); | |
return optionalString.getString(); | |
} | |
public Utf8String getOptionalStringBytes() { | |
if (!hasOptionalString()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initOptionalString(); | |
return this.optionalString; | |
} | |
public Utf8String getMutableOptionalStringBytes() { | |
initOptionalString(); | |
bitField0_ |= 0x00000008; | |
return this.optionalString; | |
} | |
public LazyMessage setOptionalString(final CharSequence value) { | |
initOptionalString(); | |
bitField0_ |= 0x00000008; | |
optionalString.copyFrom(value); | |
return this; | |
} | |
private void initRepeatedDouble() { | |
if (repeatedDouble == null) { | |
repeatedDouble = RepeatedDouble.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedDouble() { | |
return (bitField0_ & 0x00000010) != 0; | |
} | |
public LazyMessage clearRepeatedDouble() { | |
bitField0_ &= ~0x00000010; | |
if (repeatedDouble != null) { | |
repeatedDouble.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedDouble()} if you want to modify it. | |
*/ | |
public RepeatedDouble getRepeatedDouble() { | |
if (!hasRepeatedDouble()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedDouble(); | |
return repeatedDouble; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedDouble getMutableRepeatedDouble() { | |
initRepeatedDouble(); | |
bitField0_ |= 0x00000010; | |
return repeatedDouble; | |
} | |
public LazyMessage addRepeatedDouble(final double value) { | |
initRepeatedDouble(); | |
bitField0_ |= 0x00000010; | |
repeatedDouble.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedDouble(final double... values) { | |
initRepeatedDouble(); | |
bitField0_ |= 0x00000010; | |
repeatedDouble.addAll(values); | |
return this; | |
} | |
private void initRepeatedFixed64() { | |
if (repeatedFixed64 == null) { | |
repeatedFixed64 = RepeatedLong.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedFixed64() { | |
return (bitField0_ & 0x00000020) != 0; | |
} | |
public LazyMessage clearRepeatedFixed64() { | |
bitField0_ &= ~0x00000020; | |
if (repeatedFixed64 != null) { | |
repeatedFixed64.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedFixed64()} if you want to modify it. | |
*/ | |
public RepeatedLong getRepeatedFixed64() { | |
if (!hasRepeatedFixed64()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedFixed64(); | |
return repeatedFixed64; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedLong getMutableRepeatedFixed64() { | |
initRepeatedFixed64(); | |
bitField0_ |= 0x00000020; | |
return repeatedFixed64; | |
} | |
public LazyMessage addRepeatedFixed64(final long value) { | |
initRepeatedFixed64(); | |
bitField0_ |= 0x00000020; | |
repeatedFixed64.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedFixed64(final long... values) { | |
initRepeatedFixed64(); | |
bitField0_ |= 0x00000020; | |
repeatedFixed64.addAll(values); | |
return this; | |
} | |
private void initRepeatedSfixed64() { | |
if (repeatedSfixed64 == null) { | |
repeatedSfixed64 = RepeatedLong.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedSfixed64() { | |
return (bitField0_ & 0x00000040) != 0; | |
} | |
public LazyMessage clearRepeatedSfixed64() { | |
bitField0_ &= ~0x00000040; | |
if (repeatedSfixed64 != null) { | |
repeatedSfixed64.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedSfixed64()} if you want to modify it. | |
*/ | |
public RepeatedLong getRepeatedSfixed64() { | |
if (!hasRepeatedSfixed64()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedSfixed64(); | |
return repeatedSfixed64; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedLong getMutableRepeatedSfixed64() { | |
initRepeatedSfixed64(); | |
bitField0_ |= 0x00000040; | |
return repeatedSfixed64; | |
} | |
public LazyMessage addRepeatedSfixed64(final long value) { | |
initRepeatedSfixed64(); | |
bitField0_ |= 0x00000040; | |
repeatedSfixed64.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedSfixed64(final long... values) { | |
initRepeatedSfixed64(); | |
bitField0_ |= 0x00000040; | |
repeatedSfixed64.addAll(values); | |
return this; | |
} | |
private void initRepeatedInt64() { | |
if (repeatedInt64 == null) { | |
repeatedInt64 = RepeatedLong.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedInt64() { | |
return (bitField0_ & 0x00000080) != 0; | |
} | |
public LazyMessage clearRepeatedInt64() { | |
bitField0_ &= ~0x00000080; | |
if (repeatedInt64 != null) { | |
repeatedInt64.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedInt64()} if you want to modify it. | |
*/ | |
public RepeatedLong getRepeatedInt64() { | |
if (!hasRepeatedInt64()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedInt64(); | |
return repeatedInt64; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedLong getMutableRepeatedInt64() { | |
initRepeatedInt64(); | |
bitField0_ |= 0x00000080; | |
return repeatedInt64; | |
} | |
public LazyMessage addRepeatedInt64(final long value) { | |
initRepeatedInt64(); | |
bitField0_ |= 0x00000080; | |
repeatedInt64.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedInt64(final long... values) { | |
initRepeatedInt64(); | |
bitField0_ |= 0x00000080; | |
repeatedInt64.addAll(values); | |
return this; | |
} | |
private void initRepeatedUint64() { | |
if (repeatedUint64 == null) { | |
repeatedUint64 = RepeatedLong.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedUint64() { | |
return (bitField0_ & 0x00000100) != 0; | |
} | |
public LazyMessage clearRepeatedUint64() { | |
bitField0_ &= ~0x00000100; | |
if (repeatedUint64 != null) { | |
repeatedUint64.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedUint64()} if you want to modify it. | |
*/ | |
public RepeatedLong getRepeatedUint64() { | |
if (!hasRepeatedUint64()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedUint64(); | |
return repeatedUint64; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedLong getMutableRepeatedUint64() { | |
initRepeatedUint64(); | |
bitField0_ |= 0x00000100; | |
return repeatedUint64; | |
} | |
public LazyMessage addRepeatedUint64(final long value) { | |
initRepeatedUint64(); | |
bitField0_ |= 0x00000100; | |
repeatedUint64.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedUint64(final long... values) { | |
initRepeatedUint64(); | |
bitField0_ |= 0x00000100; | |
repeatedUint64.addAll(values); | |
return this; | |
} | |
private void initRepeatedSint64() { | |
if (repeatedSint64 == null) { | |
repeatedSint64 = RepeatedLong.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedSint64() { | |
return (bitField0_ & 0x00000200) != 0; | |
} | |
public LazyMessage clearRepeatedSint64() { | |
bitField0_ &= ~0x00000200; | |
if (repeatedSint64 != null) { | |
repeatedSint64.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedSint64()} if you want to modify it. | |
*/ | |
public RepeatedLong getRepeatedSint64() { | |
if (!hasRepeatedSint64()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedSint64(); | |
return repeatedSint64; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedLong getMutableRepeatedSint64() { | |
initRepeatedSint64(); | |
bitField0_ |= 0x00000200; | |
return repeatedSint64; | |
} | |
public LazyMessage addRepeatedSint64(final long value) { | |
initRepeatedSint64(); | |
bitField0_ |= 0x00000200; | |
repeatedSint64.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedSint64(final long... values) { | |
initRepeatedSint64(); | |
bitField0_ |= 0x00000200; | |
repeatedSint64.addAll(values); | |
return this; | |
} | |
private void initRepeatedFloat() { | |
if (repeatedFloat == null) { | |
repeatedFloat = RepeatedFloat.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedFloat() { | |
return (bitField0_ & 0x00000400) != 0; | |
} | |
public LazyMessage clearRepeatedFloat() { | |
bitField0_ &= ~0x00000400; | |
if (repeatedFloat != null) { | |
repeatedFloat.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedFloat()} if you want to modify it. | |
*/ | |
public RepeatedFloat getRepeatedFloat() { | |
if (!hasRepeatedFloat()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedFloat(); | |
return repeatedFloat; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedFloat getMutableRepeatedFloat() { | |
initRepeatedFloat(); | |
bitField0_ |= 0x00000400; | |
return repeatedFloat; | |
} | |
public LazyMessage addRepeatedFloat(final float value) { | |
initRepeatedFloat(); | |
bitField0_ |= 0x00000400; | |
repeatedFloat.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedFloat(final float... values) { | |
initRepeatedFloat(); | |
bitField0_ |= 0x00000400; | |
repeatedFloat.addAll(values); | |
return this; | |
} | |
private void initRepeatedFixed32() { | |
if (repeatedFixed32 == null) { | |
repeatedFixed32 = RepeatedInt.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedFixed32() { | |
return (bitField0_ & 0x00000800) != 0; | |
} | |
public LazyMessage clearRepeatedFixed32() { | |
bitField0_ &= ~0x00000800; | |
if (repeatedFixed32 != null) { | |
repeatedFixed32.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedFixed32()} if you want to modify it. | |
*/ | |
public RepeatedInt getRepeatedFixed32() { | |
if (!hasRepeatedFixed32()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedFixed32(); | |
return repeatedFixed32; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedInt getMutableRepeatedFixed32() { | |
initRepeatedFixed32(); | |
bitField0_ |= 0x00000800; | |
return repeatedFixed32; | |
} | |
public LazyMessage addRepeatedFixed32(final int value) { | |
initRepeatedFixed32(); | |
bitField0_ |= 0x00000800; | |
repeatedFixed32.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedFixed32(final int... values) { | |
initRepeatedFixed32(); | |
bitField0_ |= 0x00000800; | |
repeatedFixed32.addAll(values); | |
return this; | |
} | |
private void initRepeatedSfixed32() { | |
if (repeatedSfixed32 == null) { | |
repeatedSfixed32 = RepeatedInt.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedSfixed32() { | |
return (bitField0_ & 0x00001000) != 0; | |
} | |
public LazyMessage clearRepeatedSfixed32() { | |
bitField0_ &= ~0x00001000; | |
if (repeatedSfixed32 != null) { | |
repeatedSfixed32.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedSfixed32()} if you want to modify it. | |
*/ | |
public RepeatedInt getRepeatedSfixed32() { | |
if (!hasRepeatedSfixed32()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedSfixed32(); | |
return repeatedSfixed32; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedInt getMutableRepeatedSfixed32() { | |
initRepeatedSfixed32(); | |
bitField0_ |= 0x00001000; | |
return repeatedSfixed32; | |
} | |
public LazyMessage addRepeatedSfixed32(final int value) { | |
initRepeatedSfixed32(); | |
bitField0_ |= 0x00001000; | |
repeatedSfixed32.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedSfixed32(final int... values) { | |
initRepeatedSfixed32(); | |
bitField0_ |= 0x00001000; | |
repeatedSfixed32.addAll(values); | |
return this; | |
} | |
private void initRepeatedInt32() { | |
if (repeatedInt32 == null) { | |
repeatedInt32 = RepeatedInt.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedInt32() { | |
return (bitField0_ & 0x00002000) != 0; | |
} | |
public LazyMessage clearRepeatedInt32() { | |
bitField0_ &= ~0x00002000; | |
if (repeatedInt32 != null) { | |
repeatedInt32.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedInt32()} if you want to modify it. | |
*/ | |
public RepeatedInt getRepeatedInt32() { | |
if (!hasRepeatedInt32()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedInt32(); | |
return repeatedInt32; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedInt getMutableRepeatedInt32() { | |
initRepeatedInt32(); | |
bitField0_ |= 0x00002000; | |
return repeatedInt32; | |
} | |
public LazyMessage addRepeatedInt32(final int value) { | |
initRepeatedInt32(); | |
bitField0_ |= 0x00002000; | |
repeatedInt32.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedInt32(final int... values) { | |
initRepeatedInt32(); | |
bitField0_ |= 0x00002000; | |
repeatedInt32.addAll(values); | |
return this; | |
} | |
private void initRepeatedUint32() { | |
if (repeatedUint32 == null) { | |
repeatedUint32 = RepeatedInt.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedUint32() { | |
return (bitField0_ & 0x00004000) != 0; | |
} | |
public LazyMessage clearRepeatedUint32() { | |
bitField0_ &= ~0x00004000; | |
if (repeatedUint32 != null) { | |
repeatedUint32.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedUint32()} if you want to modify it. | |
*/ | |
public RepeatedInt getRepeatedUint32() { | |
if (!hasRepeatedUint32()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedUint32(); | |
return repeatedUint32; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedInt getMutableRepeatedUint32() { | |
initRepeatedUint32(); | |
bitField0_ |= 0x00004000; | |
return repeatedUint32; | |
} | |
public LazyMessage addRepeatedUint32(final int value) { | |
initRepeatedUint32(); | |
bitField0_ |= 0x00004000; | |
repeatedUint32.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedUint32(final int... values) { | |
initRepeatedUint32(); | |
bitField0_ |= 0x00004000; | |
repeatedUint32.addAll(values); | |
return this; | |
} | |
private void initRepeatedSint32() { | |
if (repeatedSint32 == null) { | |
repeatedSint32 = RepeatedInt.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedSint32() { | |
return (bitField0_ & 0x00008000) != 0; | |
} | |
public LazyMessage clearRepeatedSint32() { | |
bitField0_ &= ~0x00008000; | |
if (repeatedSint32 != null) { | |
repeatedSint32.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedSint32()} if you want to modify it. | |
*/ | |
public RepeatedInt getRepeatedSint32() { | |
if (!hasRepeatedSint32()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedSint32(); | |
return repeatedSint32; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedInt getMutableRepeatedSint32() { | |
initRepeatedSint32(); | |
bitField0_ |= 0x00008000; | |
return repeatedSint32; | |
} | |
public LazyMessage addRepeatedSint32(final int value) { | |
initRepeatedSint32(); | |
bitField0_ |= 0x00008000; | |
repeatedSint32.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedSint32(final int... values) { | |
initRepeatedSint32(); | |
bitField0_ |= 0x00008000; | |
repeatedSint32.addAll(values); | |
return this; | |
} | |
private void initRepeatedBool() { | |
if (repeatedBool == null) { | |
repeatedBool = RepeatedBoolean.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedBool() { | |
return (bitField0_ & 0x00010000) != 0; | |
} | |
public LazyMessage clearRepeatedBool() { | |
bitField0_ &= ~0x00010000; | |
if (repeatedBool != null) { | |
repeatedBool.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedBool()} if you want to modify it. | |
*/ | |
public RepeatedBoolean getRepeatedBool() { | |
if (!hasRepeatedBool()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedBool(); | |
return repeatedBool; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedBoolean getMutableRepeatedBool() { | |
initRepeatedBool(); | |
bitField0_ |= 0x00010000; | |
return repeatedBool; | |
} | |
public LazyMessage addRepeatedBool(final boolean value) { | |
initRepeatedBool(); | |
bitField0_ |= 0x00010000; | |
repeatedBool.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedBool(final boolean... values) { | |
initRepeatedBool(); | |
bitField0_ |= 0x00010000; | |
repeatedBool.addAll(values); | |
return this; | |
} | |
private void initRepeatedNestedMessage() { | |
if (repeatedNestedMessage == null) { | |
repeatedNestedMessage = RepeatedMessage.newEmptyInstance(NestedMessage.getFactory()); | |
} | |
} | |
public boolean hasRepeatedNestedMessage() { | |
return (bitField0_ & 0x00020000) != 0; | |
} | |
public LazyMessage clearRepeatedNestedMessage() { | |
bitField0_ &= ~0x00020000; | |
if (repeatedNestedMessage != null) { | |
repeatedNestedMessage.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedNestedMessage()} if you want to modify it. | |
*/ | |
public RepeatedMessage<NestedMessage> getRepeatedNestedMessage() { | |
if (!hasRepeatedNestedMessage()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedNestedMessage(); | |
return repeatedNestedMessage; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedMessage<NestedMessage> getMutableRepeatedNestedMessage() { | |
initRepeatedNestedMessage(); | |
bitField0_ |= 0x00020000; | |
return repeatedNestedMessage; | |
} | |
public LazyMessage addRepeatedNestedMessage(final NestedMessage value) { | |
initRepeatedNestedMessage(); | |
bitField0_ |= 0x00020000; | |
repeatedNestedMessage.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedNestedMessage(final NestedMessage... values) { | |
initRepeatedNestedMessage(); | |
bitField0_ |= 0x00020000; | |
repeatedNestedMessage.addAll(values); | |
return this; | |
} | |
private void initRepeatedGroup() { | |
if (repeatedGroup == null) { | |
repeatedGroup = RepeatedMessage.newEmptyInstance(RepeatedGroup.getFactory()); | |
} | |
} | |
public boolean hasRepeatedGroup() { | |
return (bitField0_ & 0x00040000) != 0; | |
} | |
public LazyMessage clearRepeatedGroup() { | |
bitField0_ &= ~0x00040000; | |
if (repeatedGroup != null) { | |
repeatedGroup.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedGroup()} if you want to modify it. | |
*/ | |
public RepeatedMessage<RepeatedGroup> getRepeatedGroup() { | |
if (!hasRepeatedGroup()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedGroup(); | |
return repeatedGroup; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedMessage<RepeatedGroup> getMutableRepeatedGroup() { | |
initRepeatedGroup(); | |
bitField0_ |= 0x00040000; | |
return repeatedGroup; | |
} | |
public LazyMessage addRepeatedGroup(final RepeatedGroup value) { | |
initRepeatedGroup(); | |
bitField0_ |= 0x00040000; | |
repeatedGroup.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedGroup(final RepeatedGroup... values) { | |
initRepeatedGroup(); | |
bitField0_ |= 0x00040000; | |
repeatedGroup.addAll(values); | |
return this; | |
} | |
private void initRepeatedBytes() { | |
if (repeatedBytes == null) { | |
repeatedBytes = RepeatedBytes.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedBytes() { | |
return (bitField0_ & 0x00080000) != 0; | |
} | |
public LazyMessage clearRepeatedBytes() { | |
bitField0_ &= ~0x00080000; | |
if (repeatedBytes != null) { | |
repeatedBytes.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedBytes()} if you want to modify it. | |
*/ | |
public RepeatedBytes getRepeatedBytes() { | |
if (!hasRepeatedBytes()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedBytes(); | |
return repeatedBytes; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedBytes getMutableRepeatedBytes() { | |
initRepeatedBytes(); | |
bitField0_ |= 0x00080000; | |
return repeatedBytes; | |
} | |
public LazyMessage addRepeatedBytes(final byte[] value) { | |
initRepeatedBytes(); | |
bitField0_ |= 0x00080000; | |
repeatedBytes.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedBytes(final byte[]... values) { | |
initRepeatedBytes(); | |
bitField0_ |= 0x00080000; | |
repeatedBytes.addAll(values); | |
return this; | |
} | |
public LazyMessage setRepeatedBytes(final byte[]... values) { | |
initRepeatedBytes(); | |
bitField0_ |= 0x00080000; | |
repeatedBytes.copyFrom(values); | |
return this; | |
} | |
private void initRepeatedString() { | |
if (repeatedString == null) { | |
repeatedString = RepeatedString.newEmptyInstance(); | |
} | |
} | |
public boolean hasRepeatedString() { | |
return (bitField0_ & 0x00100000) != 0; | |
} | |
public LazyMessage clearRepeatedString() { | |
bitField0_ &= ~0x00100000; | |
if (repeatedString != null) { | |
repeatedString.clear(); | |
} | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRepeatedString()} if you want to modify it. | |
*/ | |
public RepeatedString getRepeatedString() { | |
if (!hasRepeatedString()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
initRepeatedString(); | |
return repeatedString; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public RepeatedString getMutableRepeatedString() { | |
initRepeatedString(); | |
bitField0_ |= 0x00100000; | |
return repeatedString; | |
} | |
public LazyMessage addRepeatedString(final CharSequence value) { | |
initRepeatedString(); | |
bitField0_ |= 0x00100000; | |
repeatedString.add(value); | |
return this; | |
} | |
public LazyMessage addAllRepeatedString(final CharSequence... values) { | |
initRepeatedString(); | |
bitField0_ |= 0x00100000; | |
repeatedString.addAll(values); | |
return this; | |
} | |
@Override | |
public LazyMessage copyFrom(final LazyMessage other) { | |
cachedSize = other.cachedSize; | |
if ((bitField0_ | other.bitField0_) != 0) { | |
bitField0_ = other.bitField0_; | |
if (other.hasOptionalNestedMessage()) { | |
initOptionalNestedMessage(); | |
optionalNestedMessage.copyFrom(other.optionalNestedMessage); | |
} else { | |
clearOptionalNestedMessage(); | |
} | |
if (other.hasOptionalGroup()) { | |
initOptionalGroup(); | |
optionalGroup.copyFrom(other.optionalGroup); | |
} else { | |
clearOptionalGroup(); | |
} | |
if (other.hasOptionalBytes()) { | |
initOptionalBytes(); | |
optionalBytes.copyFrom(other.optionalBytes); | |
} else { | |
clearOptionalBytes(); | |
} | |
if (other.hasOptionalString()) { | |
initOptionalString(); | |
optionalString.copyFrom(other.optionalString); | |
} else { | |
clearOptionalString(); | |
} | |
if (other.hasRepeatedDouble()) { | |
initRepeatedDouble(); | |
repeatedDouble.copyFrom(other.repeatedDouble); | |
} else { | |
clearRepeatedDouble(); | |
} | |
if (other.hasRepeatedFixed64()) { | |
initRepeatedFixed64(); | |
repeatedFixed64.copyFrom(other.repeatedFixed64); | |
} else { | |
clearRepeatedFixed64(); | |
} | |
if (other.hasRepeatedSfixed64()) { | |
initRepeatedSfixed64(); | |
repeatedSfixed64.copyFrom(other.repeatedSfixed64); | |
} else { | |
clearRepeatedSfixed64(); | |
} | |
if (other.hasRepeatedInt64()) { | |
initRepeatedInt64(); | |
repeatedInt64.copyFrom(other.repeatedInt64); | |
} else { | |
clearRepeatedInt64(); | |
} | |
if (other.hasRepeatedUint64()) { | |
initRepeatedUint64(); | |
repeatedUint64.copyFrom(other.repeatedUint64); | |
} else { | |
clearRepeatedUint64(); | |
} | |
if (other.hasRepeatedSint64()) { | |
initRepeatedSint64(); | |
repeatedSint64.copyFrom(other.repeatedSint64); | |
} else { | |
clearRepeatedSint64(); | |
} | |
if (other.hasRepeatedFloat()) { | |
initRepeatedFloat(); | |
repeatedFloat.copyFrom(other.repeatedFloat); | |
} else { | |
clearRepeatedFloat(); | |
} | |
if (other.hasRepeatedFixed32()) { | |
initRepeatedFixed32(); | |
repeatedFixed32.copyFrom(other.repeatedFixed32); | |
} else { | |
clearRepeatedFixed32(); | |
} | |
if (other.hasRepeatedSfixed32()) { | |
initRepeatedSfixed32(); | |
repeatedSfixed32.copyFrom(other.repeatedSfixed32); | |
} else { | |
clearRepeatedSfixed32(); | |
} | |
if (other.hasRepeatedInt32()) { | |
initRepeatedInt32(); | |
repeatedInt32.copyFrom(other.repeatedInt32); | |
} else { | |
clearRepeatedInt32(); | |
} | |
if (other.hasRepeatedUint32()) { | |
initRepeatedUint32(); | |
repeatedUint32.copyFrom(other.repeatedUint32); | |
} else { | |
clearRepeatedUint32(); | |
} | |
if (other.hasRepeatedSint32()) { | |
initRepeatedSint32(); | |
repeatedSint32.copyFrom(other.repeatedSint32); | |
} else { | |
clearRepeatedSint32(); | |
} | |
if (other.hasRepeatedBool()) { | |
initRepeatedBool(); | |
repeatedBool.copyFrom(other.repeatedBool); | |
} else { | |
clearRepeatedBool(); | |
} | |
if (other.hasRepeatedNestedMessage()) { | |
initRepeatedNestedMessage(); | |
repeatedNestedMessage.copyFrom(other.repeatedNestedMessage); | |
} else { | |
clearRepeatedNestedMessage(); | |
} | |
if (other.hasRepeatedGroup()) { | |
initRepeatedGroup(); | |
repeatedGroup.copyFrom(other.repeatedGroup); | |
} else { | |
clearRepeatedGroup(); | |
} | |
if (other.hasRepeatedBytes()) { | |
initRepeatedBytes(); | |
repeatedBytes.copyFrom(other.repeatedBytes); | |
} else { | |
clearRepeatedBytes(); | |
} | |
if (other.hasRepeatedString()) { | |
initRepeatedString(); | |
repeatedString.copyFrom(other.repeatedString); | |
} else { | |
clearRepeatedString(); | |
} | |
} | |
unknownBytes.copyFrom(other.unknownBytes); | |
return this; | |
} | |
@Override | |
public LazyMessage mergeFrom(final LazyMessage other) { | |
if (other.isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
if (other.hasOptionalNestedMessage()) { | |
getMutableOptionalNestedMessage().mergeFrom(other.optionalNestedMessage); | |
} | |
if (other.hasOptionalGroup()) { | |
getMutableOptionalGroup().mergeFrom(other.optionalGroup); | |
} | |
if (other.hasOptionalBytes()) { | |
getMutableOptionalBytes().copyFrom(other.optionalBytes); | |
} | |
if (other.hasOptionalString()) { | |
getMutableOptionalStringBytes().copyFrom(other.optionalString); | |
} | |
if (other.hasRepeatedDouble()) { | |
getMutableRepeatedDouble().addAll(other.repeatedDouble); | |
} | |
if (other.hasRepeatedFixed64()) { | |
getMutableRepeatedFixed64().addAll(other.repeatedFixed64); | |
} | |
if (other.hasRepeatedSfixed64()) { | |
getMutableRepeatedSfixed64().addAll(other.repeatedSfixed64); | |
} | |
if (other.hasRepeatedInt64()) { | |
getMutableRepeatedInt64().addAll(other.repeatedInt64); | |
} | |
if (other.hasRepeatedUint64()) { | |
getMutableRepeatedUint64().addAll(other.repeatedUint64); | |
} | |
if (other.hasRepeatedSint64()) { | |
getMutableRepeatedSint64().addAll(other.repeatedSint64); | |
} | |
if (other.hasRepeatedFloat()) { | |
getMutableRepeatedFloat().addAll(other.repeatedFloat); | |
} | |
if (other.hasRepeatedFixed32()) { | |
getMutableRepeatedFixed32().addAll(other.repeatedFixed32); | |
} | |
if (other.hasRepeatedSfixed32()) { | |
getMutableRepeatedSfixed32().addAll(other.repeatedSfixed32); | |
} | |
if (other.hasRepeatedInt32()) { | |
getMutableRepeatedInt32().addAll(other.repeatedInt32); | |
} | |
if (other.hasRepeatedUint32()) { | |
getMutableRepeatedUint32().addAll(other.repeatedUint32); | |
} | |
if (other.hasRepeatedSint32()) { | |
getMutableRepeatedSint32().addAll(other.repeatedSint32); | |
} | |
if (other.hasRepeatedBool()) { | |
getMutableRepeatedBool().addAll(other.repeatedBool); | |
} | |
if (other.hasRepeatedNestedMessage()) { | |
getMutableRepeatedNestedMessage().addAll(other.repeatedNestedMessage); | |
} | |
if (other.hasRepeatedGroup()) { | |
getMutableRepeatedGroup().addAll(other.repeatedGroup); | |
} | |
if (other.hasRepeatedBytes()) { | |
getMutableRepeatedBytes().addAll(other.repeatedBytes); | |
} | |
if (other.hasRepeatedString()) { | |
getMutableRepeatedString().addAll(other.repeatedString); | |
} | |
if (other.unknownBytes.length() > 0) { | |
unknownBytes.addAll(other.unknownBytes); | |
} | |
return this; | |
} | |
@Override | |
public LazyMessage clear() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
if (optionalNestedMessage != null) { | |
optionalNestedMessage.clear(); | |
} | |
if (optionalGroup != null) { | |
optionalGroup.clear(); | |
} | |
if (optionalBytes != null) { | |
optionalBytes.clear(); | |
} | |
if (optionalString != null) { | |
optionalString.clear(); | |
} | |
if (repeatedDouble != null) { | |
repeatedDouble.clear(); | |
} | |
if (repeatedFixed64 != null) { | |
repeatedFixed64.clear(); | |
} | |
if (repeatedSfixed64 != null) { | |
repeatedSfixed64.clear(); | |
} | |
if (repeatedInt64 != null) { | |
repeatedInt64.clear(); | |
} | |
if (repeatedUint64 != null) { | |
repeatedUint64.clear(); | |
} | |
if (repeatedSint64 != null) { | |
repeatedSint64.clear(); | |
} | |
if (repeatedFloat != null) { | |
repeatedFloat.clear(); | |
} | |
if (repeatedFixed32 != null) { | |
repeatedFixed32.clear(); | |
} | |
if (repeatedSfixed32 != null) { | |
repeatedSfixed32.clear(); | |
} | |
if (repeatedInt32 != null) { | |
repeatedInt32.clear(); | |
} | |
if (repeatedUint32 != null) { | |
repeatedUint32.clear(); | |
} | |
if (repeatedSint32 != null) { | |
repeatedSint32.clear(); | |
} | |
if (repeatedBool != null) { | |
repeatedBool.clear(); | |
} | |
if (repeatedNestedMessage != null) { | |
repeatedNestedMessage.clear(); | |
} | |
if (repeatedGroup != null) { | |
repeatedGroup.clear(); | |
} | |
if (repeatedBytes != null) { | |
repeatedBytes.clear(); | |
} | |
if (repeatedString != null) { | |
repeatedString.clear(); | |
} | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public LazyMessage clearQuick() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
if (optionalNestedMessage != null) { | |
optionalNestedMessage.clearQuick(); | |
} | |
if (optionalGroup != null) { | |
optionalGroup.clearQuick(); | |
} | |
if (optionalBytes != null) { | |
optionalBytes.clear(); | |
} | |
if (optionalString != null) { | |
optionalString.clear(); | |
} | |
if (repeatedDouble != null) { | |
repeatedDouble.clear(); | |
} | |
if (repeatedFixed64 != null) { | |
repeatedFixed64.clear(); | |
} | |
if (repeatedSfixed64 != null) { | |
repeatedSfixed64.clear(); | |
} | |
if (repeatedInt64 != null) { | |
repeatedInt64.clear(); | |
} | |
if (repeatedUint64 != null) { | |
repeatedUint64.clear(); | |
} | |
if (repeatedSint64 != null) { | |
repeatedSint64.clear(); | |
} | |
if (repeatedFloat != null) { | |
repeatedFloat.clear(); | |
} | |
if (repeatedFixed32 != null) { | |
repeatedFixed32.clear(); | |
} | |
if (repeatedSfixed32 != null) { | |
repeatedSfixed32.clear(); | |
} | |
if (repeatedInt32 != null) { | |
repeatedInt32.clear(); | |
} | |
if (repeatedUint32 != null) { | |
repeatedUint32.clear(); | |
} | |
if (repeatedSint32 != null) { | |
repeatedSint32.clear(); | |
} | |
if (repeatedBool != null) { | |
repeatedBool.clear(); | |
} | |
if (repeatedNestedMessage != null) { | |
repeatedNestedMessage.clearQuick(); | |
} | |
if (repeatedGroup != null) { | |
repeatedGroup.clearQuick(); | |
} | |
if (repeatedBytes != null) { | |
repeatedBytes.clear(); | |
} | |
if (repeatedString != null) { | |
repeatedString.clear(); | |
} | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public boolean equals(Object o) { | |
if (o == this) { | |
return true; | |
} | |
if (!(o instanceof LazyMessage)) { | |
return false; | |
} | |
LazyMessage other = (LazyMessage) o; | |
return bitField0_ == other.bitField0_ | |
&& (!hasOptionalNestedMessage() || optionalNestedMessage.equals(other.optionalNestedMessage)) | |
&& (!hasOptionalGroup() || optionalGroup.equals(other.optionalGroup)) | |
&& (!hasOptionalBytes() || optionalBytes.equals(other.optionalBytes)) | |
&& (!hasOptionalString() || optionalString.equals(other.optionalString)) | |
&& (!hasRepeatedDouble() || repeatedDouble.equals(other.repeatedDouble)) | |
&& (!hasRepeatedFixed64() || repeatedFixed64.equals(other.repeatedFixed64)) | |
&& (!hasRepeatedSfixed64() || repeatedSfixed64.equals(other.repeatedSfixed64)) | |
&& (!hasRepeatedInt64() || repeatedInt64.equals(other.repeatedInt64)) | |
&& (!hasRepeatedUint64() || repeatedUint64.equals(other.repeatedUint64)) | |
&& (!hasRepeatedSint64() || repeatedSint64.equals(other.repeatedSint64)) | |
&& (!hasRepeatedFloat() || repeatedFloat.equals(other.repeatedFloat)) | |
&& (!hasRepeatedFixed32() || repeatedFixed32.equals(other.repeatedFixed32)) | |
&& (!hasRepeatedSfixed32() || repeatedSfixed32.equals(other.repeatedSfixed32)) | |
&& (!hasRepeatedInt32() || repeatedInt32.equals(other.repeatedInt32)) | |
&& (!hasRepeatedUint32() || repeatedUint32.equals(other.repeatedUint32)) | |
&& (!hasRepeatedSint32() || repeatedSint32.equals(other.repeatedSint32)) | |
&& (!hasRepeatedBool() || repeatedBool.equals(other.repeatedBool)) | |
&& (!hasRepeatedNestedMessage() || repeatedNestedMessage.equals(other.repeatedNestedMessage)) | |
&& (!hasRepeatedGroup() || repeatedGroup.equals(other.repeatedGroup)) | |
&& (!hasRepeatedBytes() || repeatedBytes.equals(other.repeatedBytes)) | |
&& (!hasRepeatedString() || repeatedString.equals(other.repeatedString)); | |
} | |
@Override | |
public void writeTo(final ProtoSink output) throws IOException { | |
try { | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeRawLittleEndian16((short) 402); | |
output.writeMessageNoTag(optionalNestedMessage); | |
} | |
if ((bitField0_ & 0x00000002) != 0) { | |
output.writeRawLittleEndian16((short) 387); | |
output.writeGroupNoTag(optionalGroup); | |
output.writeRawLittleEndian16((short) 388); | |
} | |
if ((bitField0_ & 0x00000004) != 0) { | |
output.writeRawByte((byte) 122); | |
output.writeBytesNoTag(optionalBytes); | |
} | |
if ((bitField0_ & 0x00000008) != 0) { | |
output.writeRawByte((byte) 114); | |
output.writeStringNoTag(optionalString); | |
} | |
if ((bitField0_ & 0x00000010) != 0) { | |
for (int i = 0; i < repeatedDouble.length(); i++) { | |
output.writeRawLittleEndian16((short) 721); | |
output.writeDoubleNoTag(repeatedDouble.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00000020) != 0) { | |
for (int i = 0; i < repeatedFixed64.length(); i++) { | |
output.writeRawLittleEndian16((short) 689); | |
output.writeFixed64NoTag(repeatedFixed64.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00000040) != 0) { | |
for (int i = 0; i < repeatedSfixed64.length(); i++) { | |
output.writeRawLittleEndian16((short) 705); | |
output.writeSFixed64NoTag(repeatedSfixed64.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00000080) != 0) { | |
for (int i = 0; i < repeatedInt64.length(); i++) { | |
output.writeRawLittleEndian16((short) 640); | |
output.writeInt64NoTag(repeatedInt64.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00000100) != 0) { | |
for (int i = 0; i < repeatedUint64.length(); i++) { | |
output.writeRawLittleEndian16((short) 656); | |
output.writeUInt64NoTag(repeatedUint64.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00000200) != 0) { | |
for (int i = 0; i < repeatedSint64.length(); i++) { | |
output.writeRawLittleEndian16((short) 672); | |
output.writeSInt64NoTag(repeatedSint64.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00000400) != 0) { | |
for (int i = 0; i < repeatedFloat.length(); i++) { | |
output.writeRawLittleEndian16((short) 717); | |
output.writeFloatNoTag(repeatedFloat.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00000800) != 0) { | |
for (int i = 0; i < repeatedFixed32.length(); i++) { | |
output.writeRawLittleEndian16((short) 685); | |
output.writeFixed32NoTag(repeatedFixed32.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00001000) != 0) { | |
for (int i = 0; i < repeatedSfixed32.length(); i++) { | |
output.writeRawLittleEndian16((short) 701); | |
output.writeSFixed32NoTag(repeatedSfixed32.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00002000) != 0) { | |
for (int i = 0; i < repeatedInt32.length(); i++) { | |
output.writeRawLittleEndian16((short) 504); | |
output.writeInt32NoTag(repeatedInt32.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00004000) != 0) { | |
for (int i = 0; i < repeatedUint32.length(); i++) { | |
output.writeRawLittleEndian16((short) 648); | |
output.writeUInt32NoTag(repeatedUint32.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00008000) != 0) { | |
for (int i = 0; i < repeatedSint32.length(); i++) { | |
output.writeRawLittleEndian16((short) 664); | |
output.writeSInt32NoTag(repeatedSint32.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00010000) != 0) { | |
for (int i = 0; i < repeatedBool.length(); i++) { | |
output.writeRawLittleEndian16((short) 728); | |
output.writeBoolNoTag(repeatedBool.array()[i]); | |
} | |
} | |
if ((bitField0_ & 0x00020000) != 0) { | |
for (int i = 0; i < repeatedNestedMessage.length(); i++) { | |
output.writeRawLittleEndian16((short) 898); | |
output.writeMessageNoTag(repeatedNestedMessage.get(i)); | |
} | |
} | |
if ((bitField0_ & 0x00040000) != 0) { | |
for (int i = 0; i < repeatedGroup.length(); i++) { | |
output.writeRawLittleEndian16((short) 755); | |
output.writeGroupNoTag(repeatedGroup.get(i)); | |
output.writeRawLittleEndian16((short) 756); | |
} | |
} | |
if ((bitField0_ & 0x00080000) != 0) { | |
for (int i = 0; i < repeatedBytes.length(); i++) { | |
output.writeRawLittleEndian16((short) 746); | |
output.writeBytesNoTag(repeatedBytes.get(i)); | |
} | |
} | |
if ((bitField0_ & 0x00100000) != 0) { | |
for (int i = 0; i < repeatedString.length(); i++) { | |
output.writeRawLittleEndian16((short) 738); | |
output.writeStringNoTag(repeatedString.get(i)); | |
} | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeRawBytes(unknownBytes); | |
} | |
} catch (UninitializedMessageException nestedFail) { | |
throw rethrowFromParent(nestedFail); | |
} | |
} | |
@Override | |
protected int computeSerializedSize() { | |
try { | |
int size = 0; | |
if ((bitField0_ & 0x00000001) != 0) { | |
size += 2 + ProtoSink.computeMessageSizeNoTag(optionalNestedMessage); | |
} | |
if ((bitField0_ & 0x00000002) != 0) { | |
size += 4 + ProtoSink.computeGroupSizeNoTag(optionalGroup); | |
} | |
if ((bitField0_ & 0x00000004) != 0) { | |
size += 1 + ProtoSink.computeBytesSizeNoTag(optionalBytes); | |
} | |
if ((bitField0_ & 0x00000008) != 0) { | |
size += 1 + ProtoSink.computeStringSizeNoTag(optionalString); | |
} | |
if ((bitField0_ & 0x00000010) != 0) { | |
size += (2 + 8) * repeatedDouble.length(); | |
} | |
if ((bitField0_ & 0x00000020) != 0) { | |
size += (2 + 8) * repeatedFixed64.length(); | |
} | |
if ((bitField0_ & 0x00000040) != 0) { | |
size += (2 + 8) * repeatedSfixed64.length(); | |
} | |
if ((bitField0_ & 0x00000080) != 0) { | |
size += (2 * repeatedInt64.length()) + ProtoSink.computeRepeatedInt64SizeNoTag(repeatedInt64); | |
} | |
if ((bitField0_ & 0x00000100) != 0) { | |
size += (2 * repeatedUint64.length()) + ProtoSink.computeRepeatedUInt64SizeNoTag(repeatedUint64); | |
} | |
if ((bitField0_ & 0x00000200) != 0) { | |
size += (2 * repeatedSint64.length()) + ProtoSink.computeRepeatedSInt64SizeNoTag(repeatedSint64); | |
} | |
if ((bitField0_ & 0x00000400) != 0) { | |
size += (2 + 4) * repeatedFloat.length(); | |
} | |
if ((bitField0_ & 0x00000800) != 0) { | |
size += (2 + 4) * repeatedFixed32.length(); | |
} | |
if ((bitField0_ & 0x00001000) != 0) { | |
size += (2 + 4) * repeatedSfixed32.length(); | |
} | |
if ((bitField0_ & 0x00002000) != 0) { | |
size += (2 * repeatedInt32.length()) + ProtoSink.computeRepeatedInt32SizeNoTag(repeatedInt32); | |
} | |
if ((bitField0_ & 0x00004000) != 0) { | |
size += (2 * repeatedUint32.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(repeatedUint32); | |
} | |
if ((bitField0_ & 0x00008000) != 0) { | |
size += (2 * repeatedSint32.length()) + ProtoSink.computeRepeatedSInt32SizeNoTag(repeatedSint32); | |
} | |
if ((bitField0_ & 0x00010000) != 0) { | |
size += (2 + 1) * repeatedBool.length(); | |
} | |
if ((bitField0_ & 0x00020000) != 0) { | |
size += (2 * repeatedNestedMessage.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(repeatedNestedMessage); | |
} | |
if ((bitField0_ & 0x00040000) != 0) { | |
size += (4 * repeatedGroup.length()) + ProtoSink.computeRepeatedGroupSizeNoTag(repeatedGroup); | |
} | |
if ((bitField0_ & 0x00080000) != 0) { | |
size += (2 * repeatedBytes.length()) + ProtoSink.computeRepeatedBytesSizeNoTag(repeatedBytes); | |
} | |
if ((bitField0_ & 0x00100000) != 0) { | |
size += (2 * repeatedString.length()) + ProtoSink.computeRepeatedStringSizeNoTag(repeatedString); | |
} | |
size += unknownBytes.length(); | |
return size; | |
} catch (UninitializedMessageException nestedFail) { | |
throw rethrowFromParent(nestedFail); | |
} | |
} | |
@Override | |
public LazyMessage mergeFrom(final ProtoSource input) throws IOException { | |
// Enabled Fall-Through Optimization (QuickBuffers) | |
int tag = input.readTag(); | |
while (true) { | |
switch (tag) { | |
case 146: { | |
initOptionalNestedMessage(); | |
input.readMessage(optionalNestedMessage); | |
bitField0_ |= 0x00000001; | |
tag = input.readTag(); | |
if (tag != 131) { | |
break; | |
} | |
} | |
case 131: { | |
initOptionalGroup(); | |
input.readGroup(optionalGroup, 16); | |
bitField0_ |= 0x00000002; | |
tag = input.readTag(); | |
if (tag != 122) { | |
break; | |
} | |
} | |
case 122: { | |
initOptionalBytes(); | |
input.readBytes(optionalBytes); | |
bitField0_ |= 0x00000004; | |
tag = input.readTag(); | |
if (tag != 114) { | |
break; | |
} | |
} | |
case 114: { | |
initOptionalString(); | |
input.readString(optionalString); | |
bitField0_ |= 0x00000008; | |
tag = input.readTag(); | |
if (tag != 338) { | |
break; | |
} | |
} | |
case 338: { | |
initRepeatedDouble(); | |
input.readPackedDouble(repeatedDouble); | |
bitField0_ |= 0x00000010; | |
tag = input.readTag(); | |
if (tag != 306) { | |
break; | |
} | |
} | |
case 306: { | |
initRepeatedFixed64(); | |
input.readPackedFixed64(repeatedFixed64); | |
bitField0_ |= 0x00000020; | |
tag = input.readTag(); | |
if (tag != 322) { | |
break; | |
} | |
} | |
case 322: { | |
initRepeatedSfixed64(); | |
input.readPackedSFixed64(repeatedSfixed64); | |
bitField0_ |= 0x00000040; | |
tag = input.readTag(); | |
if (tag != 258) { | |
break; | |
} | |
} | |
case 258: { | |
initRepeatedInt64(); | |
input.readPackedInt64(repeatedInt64, tag); | |
bitField0_ |= 0x00000080; | |
tag = input.readTag(); | |
if (tag != 274) { | |
break; | |
} | |
} | |
case 274: { | |
initRepeatedUint64(); | |
input.readPackedUInt64(repeatedUint64, tag); | |
bitField0_ |= 0x00000100; | |
tag = input.readTag(); | |
if (tag != 290) { | |
break; | |
} | |
} | |
case 290: { | |
initRepeatedSint64(); | |
input.readPackedSInt64(repeatedSint64, tag); | |
bitField0_ |= 0x00000200; | |
tag = input.readTag(); | |
if (tag != 330) { | |
break; | |
} | |
} | |
case 330: { | |
initRepeatedFloat(); | |
input.readPackedFloat(repeatedFloat); | |
bitField0_ |= 0x00000400; | |
tag = input.readTag(); | |
if (tag != 298) { | |
break; | |
} | |
} | |
case 298: { | |
initRepeatedFixed32(); | |
input.readPackedFixed32(repeatedFixed32); | |
bitField0_ |= 0x00000800; | |
tag = input.readTag(); | |
if (tag != 314) { | |
break; | |
} | |
} | |
case 314: { | |
initRepeatedSfixed32(); | |
input.readPackedSFixed32(repeatedSfixed32); | |
bitField0_ |= 0x00001000; | |
tag = input.readTag(); | |
if (tag != 250) { | |
break; | |
} | |
} | |
case 250: { | |
initRepeatedInt32(); | |
input.readPackedInt32(repeatedInt32, tag); | |
bitField0_ |= 0x00002000; | |
tag = input.readTag(); | |
if (tag != 266) { | |
break; | |
} | |
} | |
case 266: { | |
initRepeatedUint32(); | |
input.readPackedUInt32(repeatedUint32, tag); | |
bitField0_ |= 0x00004000; | |
tag = input.readTag(); | |
if (tag != 282) { | |
break; | |
} | |
} | |
case 282: { | |
initRepeatedSint32(); | |
input.readPackedSInt32(repeatedSint32, tag); | |
bitField0_ |= 0x00008000; | |
tag = input.readTag(); | |
if (tag != 346) { | |
break; | |
} | |
} | |
case 346: { | |
initRepeatedBool(); | |
input.readPackedBool(repeatedBool); | |
bitField0_ |= 0x00010000; | |
tag = input.readTag(); | |
if (tag != 386) { | |
break; | |
} | |
} | |
case 386: { | |
initRepeatedNestedMessage(); | |
tag = input.readRepeatedMessage(repeatedNestedMessage, tag); | |
bitField0_ |= 0x00020000; | |
if (tag != 371) { | |
break; | |
} | |
} | |
case 371: { | |
initRepeatedGroup(); | |
tag = input.readRepeatedGroup(repeatedGroup, tag); | |
bitField0_ |= 0x00040000; | |
if (tag != 362) { | |
break; | |
} | |
} | |
case 362: { | |
initRepeatedBytes(); | |
tag = input.readRepeatedBytes(repeatedBytes, tag); | |
bitField0_ |= 0x00080000; | |
if (tag != 354) { | |
break; | |
} | |
} | |
case 354: { | |
initRepeatedString(); | |
tag = input.readRepeatedString(repeatedString, tag); | |
bitField0_ |= 0x00100000; | |
if (tag != 0) { | |
break; | |
} | |
} | |
case 0: { | |
return this; | |
} | |
default: { | |
if (!input.skipField(tag, unknownBytes)) { | |
return this; | |
} | |
tag = input.readTag(); | |
break; | |
} | |
case 337: { | |
initRepeatedDouble(); | |
tag = input.readRepeatedDouble(repeatedDouble, tag); | |
bitField0_ |= 0x00000010; | |
break; | |
} | |
case 305: { | |
initRepeatedFixed64(); | |
tag = input.readRepeatedFixed64(repeatedFixed64, tag); | |
bitField0_ |= 0x00000020; | |
break; | |
} | |
case 321: { | |
initRepeatedSfixed64(); | |
tag = input.readRepeatedSFixed64(repeatedSfixed64, tag); | |
bitField0_ |= 0x00000040; | |
break; | |
} | |
case 256: { | |
initRepeatedInt64(); | |
tag = input.readRepeatedInt64(repeatedInt64, tag); | |
bitField0_ |= 0x00000080; | |
break; | |
} | |
case 272: { | |
initRepeatedUint64(); | |
tag = input.readRepeatedUInt64(repeatedUint64, tag); | |
bitField0_ |= 0x00000100; | |
break; | |
} | |
case 288: { | |
initRepeatedSint64(); | |
tag = input.readRepeatedSInt64(repeatedSint64, tag); | |
bitField0_ |= 0x00000200; | |
break; | |
} | |
case 333: { | |
initRepeatedFloat(); | |
tag = input.readRepeatedFloat(repeatedFloat, tag); | |
bitField0_ |= 0x00000400; | |
break; | |
} | |
case 301: { | |
initRepeatedFixed32(); | |
tag = input.readRepeatedFixed32(repeatedFixed32, tag); | |
bitField0_ |= 0x00000800; | |
break; | |
} | |
case 317: { | |
initRepeatedSfixed32(); | |
tag = input.readRepeatedSFixed32(repeatedSfixed32, tag); | |
bitField0_ |= 0x00001000; | |
break; | |
} | |
case 248: { | |
initRepeatedInt32(); | |
tag = input.readRepeatedInt32(repeatedInt32, tag); | |
bitField0_ |= 0x00002000; | |
break; | |
} | |
case 264: { | |
initRepeatedUint32(); | |
tag = input.readRepeatedUInt32(repeatedUint32, tag); | |
bitField0_ |= 0x00004000; | |
break; | |
} | |
case 280: { | |
initRepeatedSint32(); | |
tag = input.readRepeatedSInt32(repeatedSint32, tag); | |
bitField0_ |= 0x00008000; | |
break; | |
} | |
case 344: { | |
initRepeatedBool(); | |
tag = input.readRepeatedBool(repeatedBool, tag); | |
bitField0_ |= 0x00010000; | |
break; | |
} | |
} | |
} | |
} | |
@Override | |
public final boolean isInitialized() { | |
if (hasOptionalNestedMessage() && !optionalNestedMessage.isInitialized()) { | |
return false; | |
} | |
if (hasRepeatedNestedMessage() && !repeatedNestedMessage.isInitialized()) { | |
return false; | |
} | |
return true; | |
} | |
@Override | |
protected final void getMissingFields(String prefix, List<String> results) { | |
if (hasOptionalNestedMessage() && !optionalNestedMessage.isInitialized()) { | |
getMissingFields(prefix, "optional_nested_message", optionalNestedMessage, results); | |
} | |
if (hasRepeatedNestedMessage() && !repeatedNestedMessage.isInitialized()) { | |
getMissingFields(prefix, "repeated_nested_message", repeatedNestedMessage, results); | |
} | |
} | |
@Override | |
public void writeTo(final JsonSink output) throws IOException { | |
try { | |
output.beginObject(); | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeMessage(FieldNames.optionalNestedMessage, optionalNestedMessage); | |
} | |
if ((bitField0_ & 0x00000002) != 0) { | |
output.writeGroup(FieldNames.optionalGroup, optionalGroup); | |
} | |
if ((bitField0_ & 0x00000004) != 0) { | |
output.writeBytes(FieldNames.optionalBytes, optionalBytes); | |
} | |
if ((bitField0_ & 0x00000008) != 0) { | |
output.writeString(FieldNames.optionalString, optionalString); | |
} | |
if ((bitField0_ & 0x00000010) != 0) { | |
output.writeRepeatedDouble(FieldNames.repeatedDouble, repeatedDouble); | |
} | |
if ((bitField0_ & 0x00000020) != 0) { | |
output.writeRepeatedFixed64(FieldNames.repeatedFixed64, repeatedFixed64); | |
} | |
if ((bitField0_ & 0x00000040) != 0) { | |
output.writeRepeatedSFixed64(FieldNames.repeatedSfixed64, repeatedSfixed64); | |
} | |
if ((bitField0_ & 0x00000080) != 0) { | |
output.writeRepeatedInt64(FieldNames.repeatedInt64, repeatedInt64); | |
} | |
if ((bitField0_ & 0x00000100) != 0) { | |
output.writeRepeatedUInt64(FieldNames.repeatedUint64, repeatedUint64); | |
} | |
if ((bitField0_ & 0x00000200) != 0) { | |
output.writeRepeatedSInt64(FieldNames.repeatedSint64, repeatedSint64); | |
} | |
if ((bitField0_ & 0x00000400) != 0) { | |
output.writeRepeatedFloat(FieldNames.repeatedFloat, repeatedFloat); | |
} | |
if ((bitField0_ & 0x00000800) != 0) { | |
output.writeRepeatedFixed32(FieldNames.repeatedFixed32, repeatedFixed32); | |
} | |
if ((bitField0_ & 0x00001000) != 0) { | |
output.writeRepeatedSFixed32(FieldNames.repeatedSfixed32, repeatedSfixed32); | |
} | |
if ((bitField0_ & 0x00002000) != 0) { | |
output.writeRepeatedInt32(FieldNames.repeatedInt32, repeatedInt32); | |
} | |
if ((bitField0_ & 0x00004000) != 0) { | |
output.writeRepeatedUInt32(FieldNames.repeatedUint32, repeatedUint32); | |
} | |
if ((bitField0_ & 0x00008000) != 0) { | |
output.writeRepeatedSInt32(FieldNames.repeatedSint32, repeatedSint32); | |
} | |
if ((bitField0_ & 0x00010000) != 0) { | |
output.writeRepeatedBool(FieldNames.repeatedBool, repeatedBool); | |
} | |
if ((bitField0_ & 0x00020000) != 0) { | |
output.writeRepeatedMessage(FieldNames.repeatedNestedMessage, repeatedNestedMessage); | |
} | |
if ((bitField0_ & 0x00040000) != 0) { | |
output.writeRepeatedGroup(FieldNames.repeatedGroup, repeatedGroup); | |
} | |
if ((bitField0_ & 0x00080000) != 0) { | |
output.writeRepeatedBytes(FieldNames.repeatedBytes, repeatedBytes); | |
} | |
if ((bitField0_ & 0x00100000) != 0) { | |
output.writeRepeatedString(FieldNames.repeatedString, repeatedString); | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeBytes(ProtoMessage.unknownBytesFieldName, unknownBytes); | |
} | |
output.endObject(); | |
} catch (UninitializedMessageException nestedFail) { | |
throw rethrowFromParent(nestedFail); | |
} | |
} | |
@Override | |
public LazyMessage mergeFrom(final JsonSource input) throws IOException { | |
if (!input.beginObject()) { | |
return this; | |
} | |
while (!input.isAtEnd()) { | |
switch (input.readFieldHash()) { | |
case -766385264: | |
case -1758324866: { | |
if (input.isAtField(FieldNames.optionalNestedMessage)) { | |
if (!input.trySkipNullValue()) { | |
initOptionalNestedMessage(); | |
input.readMessage(optionalNestedMessage); | |
bitField0_ |= 0x00000001; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case 673105695: { | |
if (input.isAtField(FieldNames.optionalGroup)) { | |
if (!input.trySkipNullValue()) { | |
initOptionalGroup(); | |
input.readGroup(optionalGroup); | |
bitField0_ |= 0x00000002; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case 639148267: | |
case -852072756: { | |
if (input.isAtField(FieldNames.optionalBytes)) { | |
if (!input.trySkipNullValue()) { | |
initOptionalBytes(); | |
input.readBytes(optionalBytes); | |
bitField0_ |= 0x00000004; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1179218031: | |
case -162429488: { | |
if (input.isAtField(FieldNames.optionalString)) { | |
if (!input.trySkipNullValue()) { | |
initOptionalString(); | |
input.readString(optionalString); | |
bitField0_ |= 0x00000008; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1453284373: | |
case 65715254: { | |
if (input.isAtField(FieldNames.repeatedDouble)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedDouble(); | |
input.readRepeatedDouble(repeatedDouble); | |
bitField0_ |= 0x00000010; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -496059304: | |
case -651711123: { | |
if (input.isAtField(FieldNames.repeatedFixed64)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedFixed64(); | |
input.readRepeatedFixed64(repeatedFixed64); | |
bitField0_ |= 0x00000020; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -90598663: | |
case -620837756: { | |
if (input.isAtField(FieldNames.repeatedSfixed64)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedSfixed64(); | |
input.readRepeatedSFixed64(repeatedSfixed64); | |
bitField0_ |= 0x00000040; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1843410029: | |
case -686031384: { | |
if (input.isAtField(FieldNames.repeatedInt64)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedInt64(); | |
input.readRepeatedInt64(repeatedInt64); | |
bitField0_ |= 0x00000080; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -972322894: | |
case 546676733: { | |
if (input.isAtField(FieldNames.repeatedUint64)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedUint64(); | |
input.readRepeatedUInt64(repeatedUint64); | |
bitField0_ |= 0x00000100; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1029581196: | |
case 489418431: { | |
if (input.isAtField(FieldNames.repeatedSint64)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedSint64(); | |
input.readRepeatedSInt64(repeatedSint64); | |
bitField0_ |= 0x00000200; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1846243582: | |
case -688864937: { | |
if (input.isAtField(FieldNames.repeatedFloat)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedFloat(); | |
input.readRepeatedFloat(repeatedFloat); | |
bitField0_ |= 0x00000400; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -496059399: | |
case -651711218: { | |
if (input.isAtField(FieldNames.repeatedFixed32)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedFixed32(); | |
input.readRepeatedFixed32(repeatedFixed32); | |
bitField0_ |= 0x00000800; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -90598758: | |
case -620837851: { | |
if (input.isAtField(FieldNames.repeatedSfixed32)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedSfixed32(); | |
input.readRepeatedSFixed32(repeatedSfixed32); | |
bitField0_ |= 0x00001000; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1843410124: | |
case -686031479: { | |
if (input.isAtField(FieldNames.repeatedInt32)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedInt32(); | |
input.readRepeatedInt32(repeatedInt32); | |
bitField0_ |= 0x00002000; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -972322989: | |
case 546676638: { | |
if (input.isAtField(FieldNames.repeatedUint32)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedUint32(); | |
input.readRepeatedUInt32(repeatedUint32); | |
bitField0_ |= 0x00004000; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1029581291: | |
case 489418336: { | |
if (input.isAtField(FieldNames.repeatedSint32)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedSint32(); | |
input.readRepeatedSInt32(repeatedSint32); | |
bitField0_ |= 0x00008000; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1860787836: | |
case -1823453041: { | |
if (input.isAtField(FieldNames.repeatedBool)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedBool(); | |
input.readRepeatedBool(repeatedBool); | |
bitField0_ |= 0x00010000; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -203953738: | |
case 1867459620: { | |
if (input.isAtField(FieldNames.repeatedNestedMessage)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedNestedMessage(); | |
input.readRepeatedMessage(repeatedNestedMessage); | |
bitField0_ |= 0x00020000; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1815588027: { | |
if (input.isAtField(FieldNames.repeatedGroup)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedGroup(); | |
input.readRepeatedGroup(repeatedGroup); | |
bitField0_ |= 0x00040000; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1849545455: | |
case -692166810: { | |
if (input.isAtField(FieldNames.repeatedBytes)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedBytes(); | |
input.readRepeatedBytes(repeatedBytes); | |
bitField0_ |= 0x00080000; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1019312085: | |
case 499687542: { | |
if (input.isAtField(FieldNames.repeatedString)) { | |
if (!input.trySkipNullValue()) { | |
initRepeatedString(); | |
input.readRepeatedString(repeatedString); | |
bitField0_ |= 0x00100000; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1345895871: | |
case 2036068406: { | |
if (input.isAtField(ProtoMessage.unknownBytesFieldName)) { | |
mergeFrom(input.readBytesAsSource()); | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
default: { | |
input.skipUnknownField(); | |
break; | |
} | |
} | |
} | |
input.endObject(); | |
return this; | |
} | |
@Override | |
public LazyMessage clone() { | |
return new LazyMessage().copyFrom(this); | |
} | |
public boolean isEmpty() { | |
return ((bitField0_) == 0); | |
} | |
public static LazyMessage parseFrom(final byte[] data) throws | |
InvalidProtocolBufferException { | |
return ProtoMessage.mergeFrom(new LazyMessage(), data).checkInitialized(); | |
} | |
public static LazyMessage parseFrom(final ProtoSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new LazyMessage(), input).checkInitialized(); | |
} | |
public static LazyMessage parseFrom(final JsonSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new LazyMessage(), input).checkInitialized(); | |
} | |
public static MessageFactory<LazyMessage> getFactory() { | |
return LazyMessageFactory.INSTANCE; | |
} | |
public enum NestedEnum implements ProtoEnum { | |
FOO("FOO", 1), | |
BAR("BAR", 2), | |
BAZ("BAZ", 3); | |
public static final int FOO_VALUE = 1; | |
public static final int BAR_VALUE = 2; | |
public static final int BAZ_VALUE = 3; | |
private final String name; | |
private final int number; | |
private NestedEnum(String name, int number) { | |
this.name = name; | |
this.number = number; | |
} | |
@Override | |
public String getName() { | |
return name; | |
} | |
@Override | |
public int getNumber() { | |
return number; | |
} | |
public static NestedEnumConverter converter() { | |
return NestedEnumConverter.INSTANCE; | |
} | |
public static NestedEnum forNumber(int value) { | |
return NestedEnumConverter.INSTANCE.forNumber(value); | |
} | |
public static NestedEnum forNumberOr(int number, NestedEnum other) { | |
NestedEnum value = forNumber(number); | |
return value == null ? other : value; | |
} | |
enum NestedEnumConverter implements ProtoEnum.EnumConverter<NestedEnum> { | |
INSTANCE; | |
private static final NestedEnum[] lookup = new NestedEnum[4]; | |
static { | |
lookup[1] = FOO; | |
lookup[2] = BAR; | |
lookup[3] = BAZ; | |
} | |
@Override | |
public final NestedEnum forNumber(final int value) { | |
if (value >= 0 && value < lookup.length) { | |
return lookup[value]; | |
} | |
return null; | |
} | |
@Override | |
public final NestedEnum forName(final CharSequence value) { | |
if (value.length() == 3) { | |
if (ProtoUtil.isEqual("FOO", value)) { | |
return FOO; | |
} | |
if (ProtoUtil.isEqual("BAR", value)) { | |
return BAR; | |
} | |
if (ProtoUtil.isEqual("BAZ", value)) { | |
return BAZ; | |
} | |
} | |
return null; | |
} | |
} | |
} | |
public static final class NestedMessage extends ProtoMessage<NestedMessage> implements Cloneable { | |
private static final long serialVersionUID = 0L; | |
/** | |
* optional int32 bb = 1; | |
*/ | |
private int bb; | |
/** | |
* required .quickbuf_unittest.LazyMessage recursive_message = 2; | |
*/ | |
private final LazyMessage recursiveMessage = LazyMessage.newInstance(); | |
/** | |
* Stores unknown fields to enable message routing without a full definition. | |
*/ | |
private final RepeatedByte unknownBytes = RepeatedByte.newEmptyInstance(); | |
private NestedMessage() { | |
} | |
public static NestedMessage newInstance() { | |
return new NestedMessage(); | |
} | |
@Override | |
public final RepeatedByte getUnknownBytes() { | |
return unknownBytes; | |
} | |
public boolean hasBb() { | |
return (bitField0_ & 0x00000002) != 0; | |
} | |
public NestedMessage clearBb() { | |
bitField0_ &= ~0x00000002; | |
bb = 0; | |
return this; | |
} | |
public int getBb() { | |
if (!hasBb()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
return bb; | |
} | |
public NestedMessage setBb(final int value) { | |
bitField0_ |= 0x00000002; | |
bb = value; | |
return this; | |
} | |
public boolean hasRecursiveMessage() { | |
return (bitField0_ & 0x00000001) != 0; | |
} | |
public NestedMessage clearRecursiveMessage() { | |
bitField0_ &= ~0x00000001; | |
recursiveMessage.clear(); | |
return this; | |
} | |
/** | |
* This method returns the internal storage object without modifying any has state. | |
* The returned object should not be modified and be treated as read-only. | |
* | |
* Use {@link #getMutableRecursiveMessage()} if you want to modify it. | |
*/ | |
public LazyMessage getRecursiveMessage() { | |
if (!hasRecursiveMessage()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
return recursiveMessage; | |
} | |
/** | |
* This method returns the internal storage object and sets the corresponding | |
* has state. The returned object will become part of this message and its | |
* contents may be modified as long as the has state is not cleared. | |
*/ | |
public LazyMessage getMutableRecursiveMessage() { | |
bitField0_ |= 0x00000001; | |
return recursiveMessage; | |
} | |
public NestedMessage setRecursiveMessage(final LazyMessage value) { | |
bitField0_ |= 0x00000001; | |
recursiveMessage.copyFrom(value); | |
return this; | |
} | |
@Override | |
public NestedMessage copyFrom(final NestedMessage other) { | |
cachedSize = other.cachedSize; | |
if ((bitField0_ | other.bitField0_) != 0) { | |
bitField0_ = other.bitField0_; | |
bb = other.bb; | |
recursiveMessage.copyFrom(other.recursiveMessage); | |
} | |
unknownBytes.copyFrom(other.unknownBytes); | |
return this; | |
} | |
@Override | |
public NestedMessage mergeFrom(final NestedMessage other) { | |
if (other.isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
if (other.hasBb()) { | |
setBb(other.bb); | |
} | |
if (other.hasRecursiveMessage()) { | |
getMutableRecursiveMessage().mergeFrom(other.recursiveMessage); | |
} | |
if (other.unknownBytes.length() > 0) { | |
unknownBytes.addAll(other.unknownBytes); | |
} | |
return this; | |
} | |
@Override | |
public NestedMessage clear() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
bb = 0; | |
recursiveMessage.clear(); | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public NestedMessage clearQuick() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
recursiveMessage.clearQuick(); | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public boolean equals(Object o) { | |
if (o == this) { | |
return true; | |
} | |
if (!(o instanceof NestedMessage)) { | |
return false; | |
} | |
NestedMessage other = (NestedMessage) o; | |
return bitField0_ == other.bitField0_ | |
&& (!hasBb() || bb == other.bb) | |
&& (!hasRecursiveMessage() || recursiveMessage.equals(other.recursiveMessage)); | |
} | |
@Override | |
public void writeTo(final ProtoSink output) throws IOException { | |
if ((((bitField0_ & 0x00000001) != 0x00000001))) { | |
throw new UninitializedMessageException(this); | |
} | |
try { | |
if ((bitField0_ & 0x00000002) != 0) { | |
output.writeRawByte((byte) 8); | |
output.writeInt32NoTag(bb); | |
} | |
output.writeRawByte((byte) 18); | |
output.writeMessageNoTag(recursiveMessage); | |
if (unknownBytes.length() > 0) { | |
output.writeRawBytes(unknownBytes); | |
} | |
} catch (UninitializedMessageException nestedFail) { | |
throw rethrowFromParent(nestedFail); | |
} | |
} | |
@Override | |
protected int computeSerializedSize() { | |
if ((((bitField0_ & 0x00000001) != 0x00000001))) { | |
throw new UninitializedMessageException(this); | |
} | |
try { | |
int size = 0; | |
if ((bitField0_ & 0x00000002) != 0) { | |
size += 1 + ProtoSink.computeInt32SizeNoTag(bb); | |
} | |
size += 1 + ProtoSink.computeMessageSizeNoTag(recursiveMessage); | |
size += unknownBytes.length(); | |
return size; | |
} catch (UninitializedMessageException nestedFail) { | |
throw rethrowFromParent(nestedFail); | |
} | |
} | |
@Override | |
public NestedMessage mergeFrom(final ProtoSource input) throws IOException { | |
// Enabled Fall-Through Optimization (QuickBuffers) | |
int tag = input.readTag(); | |
while (true) { | |
switch (tag) { | |
case 8: { | |
bb = input.readInt32(); | |
bitField0_ |= 0x00000002; | |
tag = input.readTag(); | |
if (tag != 18) { | |
break; | |
} | |
} | |
case 18: { | |
input.readMessage(recursiveMessage); | |
bitField0_ |= 0x00000001; | |
tag = input.readTag(); | |
if (tag != 0) { | |
break; | |
} | |
} | |
case 0: { | |
return this; | |
} | |
default: { | |
if (!input.skipField(tag, unknownBytes)) { | |
return this; | |
} | |
tag = input.readTag(); | |
break; | |
} | |
} | |
} | |
} | |
@Override | |
public final boolean isInitialized() { | |
if ((((bitField0_ & 0x00000001) != 0x00000001))) { | |
return false; | |
} | |
if (!recursiveMessage.isInitialized()) { | |
return false; | |
} | |
return true; | |
} | |
@Override | |
protected final void getMissingFields(String prefix, List<String> results) { | |
if (!hasRecursiveMessage()) { | |
results.add(prefix + "recursive_message"); | |
} else { | |
getMissingFields(prefix, "recursive_message", recursiveMessage, results); | |
} | |
} | |
@Override | |
public void writeTo(final JsonSink output) throws IOException { | |
if ((((bitField0_ & 0x00000001) != 0x00000001))) { | |
throw new UninitializedMessageException(this); | |
} | |
try { | |
output.beginObject(); | |
if ((bitField0_ & 0x00000002) != 0) { | |
output.writeInt32(FieldNames.bb, bb); | |
} | |
output.writeMessage(FieldNames.recursiveMessage, recursiveMessage); | |
if (unknownBytes.length() > 0) { | |
output.writeBytes(ProtoMessage.unknownBytesFieldName, unknownBytes); | |
} | |
output.endObject(); | |
} catch (UninitializedMessageException nestedFail) { | |
throw rethrowFromParent(nestedFail); | |
} | |
} | |
@Override | |
public NestedMessage mergeFrom(final JsonSource input) throws IOException { | |
if (!input.beginObject()) { | |
return this; | |
} | |
while (!input.isAtEnd()) { | |
switch (input.readFieldHash()) { | |
case 3136: { | |
if (input.isAtField(FieldNames.bb)) { | |
if (!input.trySkipNullValue()) { | |
bb = input.readInt32(); | |
bitField0_ |= 0x00000002; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1297516683: | |
case 2142288122: { | |
if (input.isAtField(FieldNames.recursiveMessage)) { | |
if (!input.trySkipNullValue()) { | |
input.readMessage(recursiveMessage); | |
bitField0_ |= 0x00000001; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1345895871: | |
case 2036068406: { | |
if (input.isAtField(ProtoMessage.unknownBytesFieldName)) { | |
mergeFrom(input.readBytesAsSource()); | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
default: { | |
input.skipUnknownField(); | |
break; | |
} | |
} | |
} | |
input.endObject(); | |
return this; | |
} | |
@Override | |
public NestedMessage clone() { | |
return new NestedMessage().copyFrom(this); | |
} | |
public boolean isEmpty() { | |
return ((bitField0_) == 0); | |
} | |
public static NestedMessage parseFrom(final byte[] data) throws | |
InvalidProtocolBufferException { | |
return ProtoMessage.mergeFrom(new NestedMessage(), data).checkInitialized(); | |
} | |
public static NestedMessage parseFrom(final ProtoSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new NestedMessage(), input).checkInitialized(); | |
} | |
public static NestedMessage parseFrom(final JsonSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new NestedMessage(), input).checkInitialized(); | |
} | |
public static MessageFactory<NestedMessage> getFactory() { | |
return NestedMessageFactory.INSTANCE; | |
} | |
private enum NestedMessageFactory implements MessageFactory<NestedMessage> { | |
INSTANCE; | |
@Override | |
public NestedMessage create() { | |
return NestedMessage.newInstance(); | |
} | |
} | |
/** | |
* Contains name constants used for serializing JSON | |
*/ | |
static class FieldNames { | |
static final FieldName bb = FieldName.forField("bb"); | |
static final FieldName recursiveMessage = FieldName.forField("recursiveMessage", "recursive_message"); | |
} | |
} | |
public static final class OptionalGroup extends ProtoMessage<OptionalGroup> implements Cloneable { | |
private static final long serialVersionUID = 0L; | |
/** | |
* optional int32 a = 17; | |
*/ | |
private int a; | |
/** | |
* Stores unknown fields to enable message routing without a full definition. | |
*/ | |
private final RepeatedByte unknownBytes = RepeatedByte.newEmptyInstance(); | |
private OptionalGroup() { | |
} | |
public static OptionalGroup newInstance() { | |
return new OptionalGroup(); | |
} | |
@Override | |
public final RepeatedByte getUnknownBytes() { | |
return unknownBytes; | |
} | |
public boolean hasA() { | |
return (bitField0_ & 0x00000001) != 0; | |
} | |
public OptionalGroup clearA() { | |
bitField0_ &= ~0x00000001; | |
a = 0; | |
return this; | |
} | |
public int getA() { | |
if (!hasA()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
return a; | |
} | |
public OptionalGroup setA(final int value) { | |
bitField0_ |= 0x00000001; | |
a = value; | |
return this; | |
} | |
@Override | |
public OptionalGroup copyFrom(final OptionalGroup other) { | |
cachedSize = other.cachedSize; | |
if ((bitField0_ | other.bitField0_) != 0) { | |
bitField0_ = other.bitField0_; | |
a = other.a; | |
} | |
unknownBytes.copyFrom(other.unknownBytes); | |
return this; | |
} | |
@Override | |
public OptionalGroup mergeFrom(final OptionalGroup other) { | |
if (other.isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
if (other.hasA()) { | |
setA(other.a); | |
} | |
if (other.unknownBytes.length() > 0) { | |
unknownBytes.addAll(other.unknownBytes); | |
} | |
return this; | |
} | |
@Override | |
public OptionalGroup clear() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
a = 0; | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public OptionalGroup clearQuick() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public boolean equals(Object o) { | |
if (o == this) { | |
return true; | |
} | |
if (!(o instanceof OptionalGroup)) { | |
return false; | |
} | |
OptionalGroup other = (OptionalGroup) o; | |
return bitField0_ == other.bitField0_ | |
&& (!hasA() || a == other.a); | |
} | |
@Override | |
public void writeTo(final ProtoSink output) throws IOException { | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeRawLittleEndian16((short) 392); | |
output.writeInt32NoTag(a); | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeRawBytes(unknownBytes); | |
} | |
} | |
@Override | |
protected int computeSerializedSize() { | |
int size = 0; | |
if ((bitField0_ & 0x00000001) != 0) { | |
size += 2 + ProtoSink.computeInt32SizeNoTag(a); | |
} | |
size += unknownBytes.length(); | |
return size; | |
} | |
@Override | |
public OptionalGroup mergeFrom(final ProtoSource input) throws IOException { | |
// Enabled Fall-Through Optimization (QuickBuffers) | |
int tag = input.readTag(); | |
while (true) { | |
switch (tag) { | |
case 136: { | |
a = input.readInt32(); | |
bitField0_ |= 0x00000001; | |
tag = input.readTag(); | |
if (tag != 0) { | |
break; | |
} | |
} | |
case 0: { | |
return this; | |
} | |
default: { | |
if (!input.skipField(tag, unknownBytes)) { | |
return this; | |
} | |
tag = input.readTag(); | |
break; | |
} | |
} | |
} | |
} | |
@Override | |
public void writeTo(final JsonSink output) throws IOException { | |
output.beginObject(); | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeInt32(FieldNames.a, a); | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeBytes(ProtoMessage.unknownBytesFieldName, unknownBytes); | |
} | |
output.endObject(); | |
} | |
@Override | |
public OptionalGroup mergeFrom(final JsonSource input) throws IOException { | |
if (!input.beginObject()) { | |
return this; | |
} | |
while (!input.isAtEnd()) { | |
switch (input.readFieldHash()) { | |
case 97: { | |
if (input.isAtField(FieldNames.a)) { | |
if (!input.trySkipNullValue()) { | |
a = input.readInt32(); | |
bitField0_ |= 0x00000001; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1345895871: | |
case 2036068406: { | |
if (input.isAtField(ProtoMessage.unknownBytesFieldName)) { | |
mergeFrom(input.readBytesAsSource()); | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
default: { | |
input.skipUnknownField(); | |
break; | |
} | |
} | |
} | |
input.endObject(); | |
return this; | |
} | |
@Override | |
public OptionalGroup clone() { | |
return new OptionalGroup().copyFrom(this); | |
} | |
public boolean isEmpty() { | |
return ((bitField0_) == 0); | |
} | |
public static OptionalGroup parseFrom(final byte[] data) throws | |
InvalidProtocolBufferException { | |
return ProtoMessage.mergeFrom(new OptionalGroup(), data).checkInitialized(); | |
} | |
public static OptionalGroup parseFrom(final ProtoSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new OptionalGroup(), input).checkInitialized(); | |
} | |
public static OptionalGroup parseFrom(final JsonSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new OptionalGroup(), input).checkInitialized(); | |
} | |
public static MessageFactory<OptionalGroup> getFactory() { | |
return OptionalGroupFactory.INSTANCE; | |
} | |
private enum OptionalGroupFactory implements MessageFactory<OptionalGroup> { | |
INSTANCE; | |
@Override | |
public OptionalGroup create() { | |
return OptionalGroup.newInstance(); | |
} | |
} | |
/** | |
* Contains name constants used for serializing JSON | |
*/ | |
static class FieldNames { | |
static final FieldName a = FieldName.forField("a"); | |
} | |
} | |
public static final class RepeatedGroup extends ProtoMessage<RepeatedGroup> implements Cloneable { | |
private static final long serialVersionUID = 0L; | |
/** | |
* optional int32 a = 47; | |
*/ | |
private int a; | |
/** | |
* Stores unknown fields to enable message routing without a full definition. | |
*/ | |
private final RepeatedByte unknownBytes = RepeatedByte.newEmptyInstance(); | |
private RepeatedGroup() { | |
} | |
public static RepeatedGroup newInstance() { | |
return new RepeatedGroup(); | |
} | |
@Override | |
public final RepeatedByte getUnknownBytes() { | |
return unknownBytes; | |
} | |
public boolean hasA() { | |
return (bitField0_ & 0x00000001) != 0; | |
} | |
public RepeatedGroup clearA() { | |
bitField0_ &= ~0x00000001; | |
a = 0; | |
return this; | |
} | |
public int getA() { | |
if (!hasA()) { | |
throw new IllegalStateException("Field is not set. Check has state before accessing."); | |
} | |
return a; | |
} | |
public RepeatedGroup setA(final int value) { | |
bitField0_ |= 0x00000001; | |
a = value; | |
return this; | |
} | |
@Override | |
public RepeatedGroup copyFrom(final RepeatedGroup other) { | |
cachedSize = other.cachedSize; | |
if ((bitField0_ | other.bitField0_) != 0) { | |
bitField0_ = other.bitField0_; | |
a = other.a; | |
} | |
unknownBytes.copyFrom(other.unknownBytes); | |
return this; | |
} | |
@Override | |
public RepeatedGroup mergeFrom(final RepeatedGroup other) { | |
if (other.isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
if (other.hasA()) { | |
setA(other.a); | |
} | |
if (other.unknownBytes.length() > 0) { | |
unknownBytes.addAll(other.unknownBytes); | |
} | |
return this; | |
} | |
@Override | |
public RepeatedGroup clear() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
a = 0; | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public RepeatedGroup clearQuick() { | |
if (isEmpty()) { | |
return this; | |
} | |
cachedSize = -1; | |
bitField0_ = 0; | |
unknownBytes.clear(); | |
return this; | |
} | |
@Override | |
public boolean equals(Object o) { | |
if (o == this) { | |
return true; | |
} | |
if (!(o instanceof RepeatedGroup)) { | |
return false; | |
} | |
RepeatedGroup other = (RepeatedGroup) o; | |
return bitField0_ == other.bitField0_ | |
&& (!hasA() || a == other.a); | |
} | |
@Override | |
public void writeTo(final ProtoSink output) throws IOException { | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeRawLittleEndian16((short) 760); | |
output.writeInt32NoTag(a); | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeRawBytes(unknownBytes); | |
} | |
} | |
@Override | |
protected int computeSerializedSize() { | |
int size = 0; | |
if ((bitField0_ & 0x00000001) != 0) { | |
size += 2 + ProtoSink.computeInt32SizeNoTag(a); | |
} | |
size += unknownBytes.length(); | |
return size; | |
} | |
@Override | |
public RepeatedGroup mergeFrom(final ProtoSource input) throws IOException { | |
// Enabled Fall-Through Optimization (QuickBuffers) | |
int tag = input.readTag(); | |
while (true) { | |
switch (tag) { | |
case 376: { | |
a = input.readInt32(); | |
bitField0_ |= 0x00000001; | |
tag = input.readTag(); | |
if (tag != 0) { | |
break; | |
} | |
} | |
case 0: { | |
return this; | |
} | |
default: { | |
if (!input.skipField(tag, unknownBytes)) { | |
return this; | |
} | |
tag = input.readTag(); | |
break; | |
} | |
} | |
} | |
} | |
@Override | |
public void writeTo(final JsonSink output) throws IOException { | |
output.beginObject(); | |
if ((bitField0_ & 0x00000001) != 0) { | |
output.writeInt32(FieldNames.a, a); | |
} | |
if (unknownBytes.length() > 0) { | |
output.writeBytes(ProtoMessage.unknownBytesFieldName, unknownBytes); | |
} | |
output.endObject(); | |
} | |
@Override | |
public RepeatedGroup mergeFrom(final JsonSource input) throws IOException { | |
if (!input.beginObject()) { | |
return this; | |
} | |
while (!input.isAtEnd()) { | |
switch (input.readFieldHash()) { | |
case 97: { | |
if (input.isAtField(FieldNames.a)) { | |
if (!input.trySkipNullValue()) { | |
a = input.readInt32(); | |
bitField0_ |= 0x00000001; | |
} | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
case -1345895871: | |
case 2036068406: { | |
if (input.isAtField(ProtoMessage.unknownBytesFieldName)) { | |
mergeFrom(input.readBytesAsSource()); | |
} else { | |
input.skipUnknownField(); | |
} | |
break; | |
} | |
default: { | |
input.skipUnknownField(); | |
break; | |
} | |
} | |
} | |
input.endObject(); | |
return this; | |
} | |
@Override | |
public RepeatedGroup clone() { | |
return new RepeatedGroup().copyFrom(this); | |
} | |
public boolean isEmpty() { | |
return ((bitField0_) == 0); | |
} | |
public static RepeatedGroup parseFrom(final byte[] data) throws | |
InvalidProtocolBufferException { | |
return ProtoMessage.mergeFrom(new RepeatedGroup(), data).checkInitialized(); | |
} | |
public static RepeatedGroup parseFrom(final ProtoSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new RepeatedGroup(), input).checkInitialized(); | |
} | |
public static RepeatedGroup parseFrom(final JsonSource input) throws IOException { | |
return ProtoMessage.mergeFrom(new RepeatedGroup(), input).checkInitialized(); | |
} | |
public static MessageFactory<RepeatedGroup> getFactory() { | |
return RepeatedGroupFactory.INSTANCE; | |
} | |
private enum RepeatedGroupFactory implements MessageFactory<RepeatedGroup> { | |
INSTANCE; | |
@Override | |
public RepeatedGroup create() { | |
return RepeatedGroup.newInstance(); | |
} | |
} | |
/** | |
* Contains name constants used for serializing JSON | |
*/ | |
static class FieldNames { | |
static final FieldName a = FieldName.forField("a"); | |
} | |
} | |
private enum LazyMessageFactory implements MessageFactory<LazyMessage> { | |
INSTANCE; | |
@Override | |
public LazyMessage create() { | |
return LazyMessage.newInstance(); | |
} | |
} | |
/** | |
* Contains name constants used for serializing JSON | |
*/ | |
static class FieldNames { | |
static final FieldName optionalNestedMessage = FieldName.forField("optionalNestedMessage", "optional_nested_message"); | |
static final FieldName optionalGroup = FieldName.forField("optionalgroup"); | |
static final FieldName optionalBytes = FieldName.forField("optionalBytes", "optional_bytes"); | |
static final FieldName optionalString = FieldName.forField("optionalString", "optional_string"); | |
static final FieldName repeatedDouble = FieldName.forField("repeatedDouble", "repeated_double"); | |
static final FieldName repeatedFixed64 = FieldName.forField("repeatedFixed64", "repeated_fixed64"); | |
static final FieldName repeatedSfixed64 = FieldName.forField("repeatedSfixed64", "repeated_sfixed64"); | |
static final FieldName repeatedInt64 = FieldName.forField("repeatedInt64", "repeated_int64"); | |
static final FieldName repeatedUint64 = FieldName.forField("repeatedUint64", "repeated_uint64"); | |
static final FieldName repeatedSint64 = FieldName.forField("repeatedSint64", "repeated_sint64"); | |
static final FieldName repeatedFloat = FieldName.forField("repeatedFloat", "repeated_float"); | |
static final FieldName repeatedFixed32 = FieldName.forField("repeatedFixed32", "repeated_fixed32"); | |
static final FieldName repeatedSfixed32 = FieldName.forField("repeatedSfixed32", "repeated_sfixed32"); | |
static final FieldName repeatedInt32 = FieldName.forField("repeatedInt32", "repeated_int32"); | |
static final FieldName repeatedUint32 = FieldName.forField("repeatedUint32", "repeated_uint32"); | |
static final FieldName repeatedSint32 = FieldName.forField("repeatedSint32", "repeated_sint32"); | |
static final FieldName repeatedBool = FieldName.forField("repeatedBool", "repeated_bool"); | |
static final FieldName repeatedNestedMessage = FieldName.forField("repeatedNestedMessage", "repeated_nested_message"); | |
static final FieldName repeatedGroup = FieldName.forField("repeatedgroup"); | |
static final FieldName repeatedBytes = FieldName.forField("repeatedBytes", "repeated_bytes"); | |
static final FieldName repeatedString = FieldName.forField("repeatedString", "repeated_string"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment