|
// Generated by the protocol buffer compiler. DO NOT EDIT! |
|
// source: src/main/proto/test2.proto |
|
|
|
package test; |
|
|
|
public final class Test2 { |
|
private Test2() {} |
|
public static void registerAllExtensions( |
|
com.google.protobuf.ExtensionRegistry registry) { |
|
} |
|
public interface TestMessageOrBuilder extends |
|
// @@protoc_insertion_point(interface_extends:test.TestMessage) |
|
com.google.protobuf.MessageOrBuilder { |
|
|
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
boolean hasData(); |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
test.Test2.MyData getData(); |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
test.Test2.MyDataOrBuilder getDataOrBuilder(); |
|
} |
|
/** |
|
* Protobuf type {@code test.TestMessage} |
|
*/ |
|
public static final class TestMessage extends |
|
com.google.protobuf.GeneratedMessage implements |
|
// @@protoc_insertion_point(message_implements:test.TestMessage) |
|
TestMessageOrBuilder { |
|
// Use TestMessage.newBuilder() to construct. |
|
private TestMessage(com.google.protobuf.GeneratedMessage.Builder<?> builder) { |
|
super(builder); |
|
this.unknownFields = builder.getUnknownFields(); |
|
} |
|
private TestMessage(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } |
|
|
|
private static final TestMessage defaultInstance; |
|
public static TestMessage getDefaultInstance() { |
|
return defaultInstance; |
|
} |
|
|
|
public TestMessage getDefaultInstanceForType() { |
|
return defaultInstance; |
|
} |
|
|
|
private final com.google.protobuf.UnknownFieldSet unknownFields; |
|
@java.lang.Override |
|
public final com.google.protobuf.UnknownFieldSet |
|
getUnknownFields() { |
|
return this.unknownFields; |
|
} |
|
private TestMessage( |
|
com.google.protobuf.CodedInputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
initFields(); |
|
int mutable_bitField0_ = 0; |
|
com.google.protobuf.UnknownFieldSet.Builder unknownFields = |
|
com.google.protobuf.UnknownFieldSet.newBuilder(); |
|
try { |
|
boolean done = false; |
|
while (!done) { |
|
int tag = input.readTag(); |
|
switch (tag) { |
|
case 0: |
|
done = true; |
|
break; |
|
default: { |
|
if (!parseUnknownField(input, unknownFields, |
|
extensionRegistry, tag)) { |
|
done = true; |
|
} |
|
break; |
|
} |
|
case 10: { |
|
test.Test2.MyData.Builder subBuilder = null; |
|
if (((bitField0_ & 0x00000001) == 0x00000001)) { |
|
subBuilder = data_.toBuilder(); |
|
} |
|
data_ = input.readMessage(test.Test2.MyData.PARSER, extensionRegistry); |
|
if (subBuilder != null) { |
|
subBuilder.mergeFrom(data_); |
|
data_ = subBuilder.buildPartial(); |
|
} |
|
bitField0_ |= 0x00000001; |
|
break; |
|
} |
|
} |
|
} |
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) { |
|
throw e.setUnfinishedMessage(this); |
|
} catch (java.io.IOException e) { |
|
throw new com.google.protobuf.InvalidProtocolBufferException( |
|
e.getMessage()).setUnfinishedMessage(this); |
|
} finally { |
|
this.unknownFields = unknownFields.build(); |
|
makeExtensionsImmutable(); |
|
} |
|
} |
|
public static final com.google.protobuf.Descriptors.Descriptor |
|
getDescriptor() { |
|
return test.Test2.internal_static_test_TestMessage_descriptor; |
|
} |
|
|
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
|
internalGetFieldAccessorTable() { |
|
return test.Test2.internal_static_test_TestMessage_fieldAccessorTable |
|
.ensureFieldAccessorsInitialized( |
|
test.Test2.TestMessage.class, test.Test2.TestMessage.Builder.class); |
|
} |
|
|
|
public static com.google.protobuf.Parser<TestMessage> PARSER = |
|
new com.google.protobuf.AbstractParser<TestMessage>() { |
|
public TestMessage parsePartialFrom( |
|
com.google.protobuf.CodedInputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return new TestMessage(input, extensionRegistry); |
|
} |
|
}; |
|
|
|
@java.lang.Override |
|
public com.google.protobuf.Parser<TestMessage> getParserForType() { |
|
return PARSER; |
|
} |
|
|
|
private int bitField0_; |
|
public static final int DATA_FIELD_NUMBER = 1; |
|
private test.Test2.MyData data_; |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public boolean hasData() { |
|
return ((bitField0_ & 0x00000001) == 0x00000001); |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public test.Test2.MyData getData() { |
|
return data_; |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public test.Test2.MyDataOrBuilder getDataOrBuilder() { |
|
return data_; |
|
} |
|
|
|
private void initFields() { |
|
data_ = test.Test2.MyData.getDefaultInstance(); |
|
} |
|
private byte memoizedIsInitialized = -1; |
|
public final boolean isInitialized() { |
|
byte isInitialized = memoizedIsInitialized; |
|
if (isInitialized == 1) return true; |
|
if (isInitialized == 0) return false; |
|
|
|
memoizedIsInitialized = 1; |
|
return true; |
|
} |
|
|
|
public void writeTo(com.google.protobuf.CodedOutputStream output) |
|
throws java.io.IOException { |
|
getSerializedSize(); |
|
if (((bitField0_ & 0x00000001) == 0x00000001)) { |
|
output.writeMessage(1, data_); |
|
} |
|
getUnknownFields().writeTo(output); |
|
} |
|
|
|
private int memoizedSerializedSize = -1; |
|
public int getSerializedSize() { |
|
int size = memoizedSerializedSize; |
|
if (size != -1) return size; |
|
|
|
size = 0; |
|
if (((bitField0_ & 0x00000001) == 0x00000001)) { |
|
size += com.google.protobuf.CodedOutputStream |
|
.computeMessageSize(1, data_); |
|
} |
|
size += getUnknownFields().getSerializedSize(); |
|
memoizedSerializedSize = size; |
|
return size; |
|
} |
|
|
|
private static final long serialVersionUID = 0L; |
|
@java.lang.Override |
|
protected java.lang.Object writeReplace() |
|
throws java.io.ObjectStreamException { |
|
return super.writeReplace(); |
|
} |
|
|
|
public static test.Test2.TestMessage parseFrom( |
|
com.google.protobuf.ByteString data) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return PARSER.parseFrom(data); |
|
} |
|
public static test.Test2.TestMessage parseFrom( |
|
com.google.protobuf.ByteString data, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return PARSER.parseFrom(data, extensionRegistry); |
|
} |
|
public static test.Test2.TestMessage parseFrom(byte[] data) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return PARSER.parseFrom(data); |
|
} |
|
public static test.Test2.TestMessage parseFrom( |
|
byte[] data, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return PARSER.parseFrom(data, extensionRegistry); |
|
} |
|
public static test.Test2.TestMessage parseFrom(java.io.InputStream input) |
|
throws java.io.IOException { |
|
return PARSER.parseFrom(input); |
|
} |
|
public static test.Test2.TestMessage parseFrom( |
|
java.io.InputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws java.io.IOException { |
|
return PARSER.parseFrom(input, extensionRegistry); |
|
} |
|
public static test.Test2.TestMessage parseDelimitedFrom(java.io.InputStream input) |
|
throws java.io.IOException { |
|
return PARSER.parseDelimitedFrom(input); |
|
} |
|
public static test.Test2.TestMessage parseDelimitedFrom( |
|
java.io.InputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws java.io.IOException { |
|
return PARSER.parseDelimitedFrom(input, extensionRegistry); |
|
} |
|
public static test.Test2.TestMessage parseFrom( |
|
com.google.protobuf.CodedInputStream input) |
|
throws java.io.IOException { |
|
return PARSER.parseFrom(input); |
|
} |
|
public static test.Test2.TestMessage parseFrom( |
|
com.google.protobuf.CodedInputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws java.io.IOException { |
|
return PARSER.parseFrom(input, extensionRegistry); |
|
} |
|
|
|
public static Builder newBuilder() { return Builder.create(); } |
|
public Builder newBuilderForType() { return newBuilder(); } |
|
public static Builder newBuilder(test.Test2.TestMessage prototype) { |
|
return newBuilder().mergeFrom(prototype); |
|
} |
|
public Builder toBuilder() { return newBuilder(this); } |
|
|
|
@java.lang.Override |
|
protected Builder newBuilderForType( |
|
com.google.protobuf.GeneratedMessage.BuilderParent parent) { |
|
Builder builder = new Builder(parent); |
|
return builder; |
|
} |
|
/** |
|
* Protobuf type {@code test.TestMessage} |
|
*/ |
|
public static final class Builder extends |
|
com.google.protobuf.GeneratedMessage.Builder<Builder> implements |
|
// @@protoc_insertion_point(builder_implements:test.TestMessage) |
|
test.Test2.TestMessageOrBuilder { |
|
public static final com.google.protobuf.Descriptors.Descriptor |
|
getDescriptor() { |
|
return test.Test2.internal_static_test_TestMessage_descriptor; |
|
} |
|
|
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
|
internalGetFieldAccessorTable() { |
|
return test.Test2.internal_static_test_TestMessage_fieldAccessorTable |
|
.ensureFieldAccessorsInitialized( |
|
test.Test2.TestMessage.class, test.Test2.TestMessage.Builder.class); |
|
} |
|
|
|
// Construct using test.Test2.TestMessage.newBuilder() |
|
private Builder() { |
|
maybeForceBuilderInitialization(); |
|
} |
|
|
|
private Builder( |
|
com.google.protobuf.GeneratedMessage.BuilderParent parent) { |
|
super(parent); |
|
maybeForceBuilderInitialization(); |
|
} |
|
private void maybeForceBuilderInitialization() { |
|
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { |
|
getDataFieldBuilder(); |
|
} |
|
} |
|
private static Builder create() { |
|
return new Builder(); |
|
} |
|
|
|
public Builder clear() { |
|
super.clear(); |
|
if (dataBuilder_ == null) { |
|
data_ = test.Test2.MyData.getDefaultInstance(); |
|
} else { |
|
dataBuilder_.clear(); |
|
} |
|
bitField0_ = (bitField0_ & ~0x00000001); |
|
return this; |
|
} |
|
|
|
public Builder clone() { |
|
return create().mergeFrom(buildPartial()); |
|
} |
|
|
|
public com.google.protobuf.Descriptors.Descriptor |
|
getDescriptorForType() { |
|
return test.Test2.internal_static_test_TestMessage_descriptor; |
|
} |
|
|
|
public test.Test2.TestMessage getDefaultInstanceForType() { |
|
return test.Test2.TestMessage.getDefaultInstance(); |
|
} |
|
|
|
public test.Test2.TestMessage build() { |
|
test.Test2.TestMessage result = buildPartial(); |
|
if (!result.isInitialized()) { |
|
throw newUninitializedMessageException(result); |
|
} |
|
return result; |
|
} |
|
|
|
public test.Test2.TestMessage buildPartial() { |
|
test.Test2.TestMessage result = new test.Test2.TestMessage(this); |
|
int from_bitField0_ = bitField0_; |
|
int to_bitField0_ = 0; |
|
if (((from_bitField0_ & 0x00000001) == 0x00000001)) { |
|
to_bitField0_ |= 0x00000001; |
|
} |
|
if (dataBuilder_ == null) { |
|
result.data_ = data_; |
|
} else { |
|
result.data_ = dataBuilder_.build(); |
|
} |
|
result.bitField0_ = to_bitField0_; |
|
onBuilt(); |
|
return result; |
|
} |
|
|
|
public Builder mergeFrom(com.google.protobuf.Message other) { |
|
if (other instanceof test.Test2.TestMessage) { |
|
return mergeFrom((test.Test2.TestMessage)other); |
|
} else { |
|
super.mergeFrom(other); |
|
return this; |
|
} |
|
} |
|
|
|
public Builder mergeFrom(test.Test2.TestMessage other) { |
|
if (other == test.Test2.TestMessage.getDefaultInstance()) return this; |
|
if (other.hasData()) { |
|
mergeData(other.getData()); |
|
} |
|
this.mergeUnknownFields(other.getUnknownFields()); |
|
return this; |
|
} |
|
|
|
public final boolean isInitialized() { |
|
return true; |
|
} |
|
|
|
public Builder mergeFrom( |
|
com.google.protobuf.CodedInputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws java.io.IOException { |
|
test.Test2.TestMessage parsedMessage = null; |
|
try { |
|
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); |
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) { |
|
parsedMessage = (test.Test2.TestMessage) e.getUnfinishedMessage(); |
|
throw e; |
|
} finally { |
|
if (parsedMessage != null) { |
|
mergeFrom(parsedMessage); |
|
} |
|
} |
|
return this; |
|
} |
|
private int bitField0_; |
|
|
|
private test.Test2.MyData data_ = test.Test2.MyData.getDefaultInstance(); |
|
private com.google.protobuf.SingleFieldBuilder< |
|
test.Test2.MyData, test.Test2.MyData.Builder, test.Test2.MyDataOrBuilder> dataBuilder_; |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public boolean hasData() { |
|
return ((bitField0_ & 0x00000001) == 0x00000001); |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public test.Test2.MyData getData() { |
|
if (dataBuilder_ == null) { |
|
return data_; |
|
} else { |
|
return dataBuilder_.getMessage(); |
|
} |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public Builder setData(test.Test2.MyData value) { |
|
if (dataBuilder_ == null) { |
|
if (value == null) { |
|
throw new NullPointerException(); |
|
} |
|
data_ = value; |
|
onChanged(); |
|
} else { |
|
dataBuilder_.setMessage(value); |
|
} |
|
bitField0_ |= 0x00000001; |
|
return this; |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public Builder setData( |
|
test.Test2.MyData.Builder builderForValue) { |
|
if (dataBuilder_ == null) { |
|
data_ = builderForValue.build(); |
|
onChanged(); |
|
} else { |
|
dataBuilder_.setMessage(builderForValue.build()); |
|
} |
|
bitField0_ |= 0x00000001; |
|
return this; |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public Builder mergeData(test.Test2.MyData value) { |
|
if (dataBuilder_ == null) { |
|
if (((bitField0_ & 0x00000001) == 0x00000001) && |
|
data_ != test.Test2.MyData.getDefaultInstance()) { |
|
data_ = |
|
test.Test2.MyData.newBuilder(data_).mergeFrom(value).buildPartial(); |
|
} else { |
|
data_ = value; |
|
} |
|
onChanged(); |
|
} else { |
|
dataBuilder_.mergeFrom(value); |
|
} |
|
bitField0_ |= 0x00000001; |
|
return this; |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public Builder clearData() { |
|
if (dataBuilder_ == null) { |
|
data_ = test.Test2.MyData.getDefaultInstance(); |
|
onChanged(); |
|
} else { |
|
dataBuilder_.clear(); |
|
} |
|
bitField0_ = (bitField0_ & ~0x00000001); |
|
return this; |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public test.Test2.MyData.Builder getDataBuilder() { |
|
bitField0_ |= 0x00000001; |
|
onChanged(); |
|
return getDataFieldBuilder().getBuilder(); |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
public test.Test2.MyDataOrBuilder getDataOrBuilder() { |
|
if (dataBuilder_ != null) { |
|
return dataBuilder_.getMessageOrBuilder(); |
|
} else { |
|
return data_; |
|
} |
|
} |
|
/** |
|
* <code>optional .test.MyData data = 1;</code> |
|
*/ |
|
private com.google.protobuf.SingleFieldBuilder< |
|
test.Test2.MyData, test.Test2.MyData.Builder, test.Test2.MyDataOrBuilder> |
|
getDataFieldBuilder() { |
|
if (dataBuilder_ == null) { |
|
dataBuilder_ = new com.google.protobuf.SingleFieldBuilder< |
|
test.Test2.MyData, test.Test2.MyData.Builder, test.Test2.MyDataOrBuilder>( |
|
getData(), |
|
getParentForChildren(), |
|
isClean()); |
|
data_ = null; |
|
} |
|
return dataBuilder_; |
|
} |
|
|
|
// @@protoc_insertion_point(builder_scope:test.TestMessage) |
|
} |
|
|
|
static { |
|
defaultInstance = new TestMessage(true); |
|
defaultInstance.initFields(); |
|
} |
|
|
|
// @@protoc_insertion_point(class_scope:test.TestMessage) |
|
} |
|
|
|
public interface MyDataOrBuilder extends |
|
// @@protoc_insertion_point(interface_extends:test.MyData) |
|
com.google.protobuf.MessageOrBuilder { |
|
} |
|
/** |
|
* Protobuf type {@code test.MyData} |
|
*/ |
|
public static final class MyData extends |
|
com.google.protobuf.GeneratedMessage implements |
|
// @@protoc_insertion_point(message_implements:test.MyData) |
|
MyDataOrBuilder { |
|
// Use MyData.newBuilder() to construct. |
|
private MyData(com.google.protobuf.GeneratedMessage.Builder<?> builder) { |
|
super(builder); |
|
this.unknownFields = builder.getUnknownFields(); |
|
} |
|
private MyData(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } |
|
|
|
private static final MyData defaultInstance; |
|
public static MyData getDefaultInstance() { |
|
return defaultInstance; |
|
} |
|
|
|
public MyData getDefaultInstanceForType() { |
|
return defaultInstance; |
|
} |
|
|
|
private final com.google.protobuf.UnknownFieldSet unknownFields; |
|
@java.lang.Override |
|
public final com.google.protobuf.UnknownFieldSet |
|
getUnknownFields() { |
|
return this.unknownFields; |
|
} |
|
private MyData( |
|
com.google.protobuf.CodedInputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
initFields(); |
|
com.google.protobuf.UnknownFieldSet.Builder unknownFields = |
|
com.google.protobuf.UnknownFieldSet.newBuilder(); |
|
try { |
|
boolean done = false; |
|
while (!done) { |
|
int tag = input.readTag(); |
|
switch (tag) { |
|
case 0: |
|
done = true; |
|
break; |
|
default: { |
|
if (!parseUnknownField(input, unknownFields, |
|
extensionRegistry, tag)) { |
|
done = true; |
|
} |
|
break; |
|
} |
|
} |
|
} |
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) { |
|
throw e.setUnfinishedMessage(this); |
|
} catch (java.io.IOException e) { |
|
throw new com.google.protobuf.InvalidProtocolBufferException( |
|
e.getMessage()).setUnfinishedMessage(this); |
|
} finally { |
|
this.unknownFields = unknownFields.build(); |
|
makeExtensionsImmutable(); |
|
} |
|
} |
|
public static final com.google.protobuf.Descriptors.Descriptor |
|
getDescriptor() { |
|
return test.Test2.internal_static_test_MyData_descriptor; |
|
} |
|
|
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
|
internalGetFieldAccessorTable() { |
|
return test.Test2.internal_static_test_MyData_fieldAccessorTable |
|
.ensureFieldAccessorsInitialized( |
|
test.Test2.MyData.class, test.Test2.MyData.Builder.class); |
|
} |
|
|
|
public static com.google.protobuf.Parser<MyData> PARSER = |
|
new com.google.protobuf.AbstractParser<MyData>() { |
|
public MyData parsePartialFrom( |
|
com.google.protobuf.CodedInputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return new MyData(input, extensionRegistry); |
|
} |
|
}; |
|
|
|
@java.lang.Override |
|
public com.google.protobuf.Parser<MyData> getParserForType() { |
|
return PARSER; |
|
} |
|
|
|
private void initFields() { |
|
} |
|
private byte memoizedIsInitialized = -1; |
|
public final boolean isInitialized() { |
|
byte isInitialized = memoizedIsInitialized; |
|
if (isInitialized == 1) return true; |
|
if (isInitialized == 0) return false; |
|
|
|
memoizedIsInitialized = 1; |
|
return true; |
|
} |
|
|
|
public void writeTo(com.google.protobuf.CodedOutputStream output) |
|
throws java.io.IOException { |
|
getSerializedSize(); |
|
getUnknownFields().writeTo(output); |
|
} |
|
|
|
private int memoizedSerializedSize = -1; |
|
public int getSerializedSize() { |
|
int size = memoizedSerializedSize; |
|
if (size != -1) return size; |
|
|
|
size = 0; |
|
size += getUnknownFields().getSerializedSize(); |
|
memoizedSerializedSize = size; |
|
return size; |
|
} |
|
|
|
private static final long serialVersionUID = 0L; |
|
@java.lang.Override |
|
protected java.lang.Object writeReplace() |
|
throws java.io.ObjectStreamException { |
|
return super.writeReplace(); |
|
} |
|
|
|
public static test.Test2.MyData parseFrom( |
|
com.google.protobuf.ByteString data) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return PARSER.parseFrom(data); |
|
} |
|
public static test.Test2.MyData parseFrom( |
|
com.google.protobuf.ByteString data, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return PARSER.parseFrom(data, extensionRegistry); |
|
} |
|
public static test.Test2.MyData parseFrom(byte[] data) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return PARSER.parseFrom(data); |
|
} |
|
public static test.Test2.MyData parseFrom( |
|
byte[] data, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws com.google.protobuf.InvalidProtocolBufferException { |
|
return PARSER.parseFrom(data, extensionRegistry); |
|
} |
|
public static test.Test2.MyData parseFrom(java.io.InputStream input) |
|
throws java.io.IOException { |
|
return PARSER.parseFrom(input); |
|
} |
|
public static test.Test2.MyData parseFrom( |
|
java.io.InputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws java.io.IOException { |
|
return PARSER.parseFrom(input, extensionRegistry); |
|
} |
|
public static test.Test2.MyData parseDelimitedFrom(java.io.InputStream input) |
|
throws java.io.IOException { |
|
return PARSER.parseDelimitedFrom(input); |
|
} |
|
public static test.Test2.MyData parseDelimitedFrom( |
|
java.io.InputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws java.io.IOException { |
|
return PARSER.parseDelimitedFrom(input, extensionRegistry); |
|
} |
|
public static test.Test2.MyData parseFrom( |
|
com.google.protobuf.CodedInputStream input) |
|
throws java.io.IOException { |
|
return PARSER.parseFrom(input); |
|
} |
|
public static test.Test2.MyData parseFrom( |
|
com.google.protobuf.CodedInputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws java.io.IOException { |
|
return PARSER.parseFrom(input, extensionRegistry); |
|
} |
|
|
|
public static Builder newBuilder() { return Builder.create(); } |
|
public Builder newBuilderForType() { return newBuilder(); } |
|
public static Builder newBuilder(test.Test2.MyData prototype) { |
|
return newBuilder().mergeFrom(prototype); |
|
} |
|
public Builder toBuilder() { return newBuilder(this); } |
|
|
|
@java.lang.Override |
|
protected Builder newBuilderForType( |
|
com.google.protobuf.GeneratedMessage.BuilderParent parent) { |
|
Builder builder = new Builder(parent); |
|
return builder; |
|
} |
|
/** |
|
* Protobuf type {@code test.MyData} |
|
*/ |
|
public static final class Builder extends |
|
com.google.protobuf.GeneratedMessage.Builder<Builder> implements |
|
// @@protoc_insertion_point(builder_implements:test.MyData) |
|
test.Test2.MyDataOrBuilder { |
|
public static final com.google.protobuf.Descriptors.Descriptor |
|
getDescriptor() { |
|
return test.Test2.internal_static_test_MyData_descriptor; |
|
} |
|
|
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
|
internalGetFieldAccessorTable() { |
|
return test.Test2.internal_static_test_MyData_fieldAccessorTable |
|
.ensureFieldAccessorsInitialized( |
|
test.Test2.MyData.class, test.Test2.MyData.Builder.class); |
|
} |
|
|
|
// Construct using test.Test2.MyData.newBuilder() |
|
private Builder() { |
|
maybeForceBuilderInitialization(); |
|
} |
|
|
|
private Builder( |
|
com.google.protobuf.GeneratedMessage.BuilderParent parent) { |
|
super(parent); |
|
maybeForceBuilderInitialization(); |
|
} |
|
private void maybeForceBuilderInitialization() { |
|
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { |
|
} |
|
} |
|
private static Builder create() { |
|
return new Builder(); |
|
} |
|
|
|
public Builder clear() { |
|
super.clear(); |
|
return this; |
|
} |
|
|
|
public Builder clone() { |
|
return create().mergeFrom(buildPartial()); |
|
} |
|
|
|
public com.google.protobuf.Descriptors.Descriptor |
|
getDescriptorForType() { |
|
return test.Test2.internal_static_test_MyData_descriptor; |
|
} |
|
|
|
public test.Test2.MyData getDefaultInstanceForType() { |
|
return test.Test2.MyData.getDefaultInstance(); |
|
} |
|
|
|
public test.Test2.MyData build() { |
|
test.Test2.MyData result = buildPartial(); |
|
if (!result.isInitialized()) { |
|
throw newUninitializedMessageException(result); |
|
} |
|
return result; |
|
} |
|
|
|
public test.Test2.MyData buildPartial() { |
|
test.Test2.MyData result = new test.Test2.MyData(this); |
|
onBuilt(); |
|
return result; |
|
} |
|
|
|
public Builder mergeFrom(com.google.protobuf.Message other) { |
|
if (other instanceof test.Test2.MyData) { |
|
return mergeFrom((test.Test2.MyData)other); |
|
} else { |
|
super.mergeFrom(other); |
|
return this; |
|
} |
|
} |
|
|
|
public Builder mergeFrom(test.Test2.MyData other) { |
|
if (other == test.Test2.MyData.getDefaultInstance()) return this; |
|
this.mergeUnknownFields(other.getUnknownFields()); |
|
return this; |
|
} |
|
|
|
public final boolean isInitialized() { |
|
return true; |
|
} |
|
|
|
public Builder mergeFrom( |
|
com.google.protobuf.CodedInputStream input, |
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
|
throws java.io.IOException { |
|
test.Test2.MyData parsedMessage = null; |
|
try { |
|
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); |
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) { |
|
parsedMessage = (test.Test2.MyData) e.getUnfinishedMessage(); |
|
throw e; |
|
} finally { |
|
if (parsedMessage != null) { |
|
mergeFrom(parsedMessage); |
|
} |
|
} |
|
return this; |
|
} |
|
|
|
// @@protoc_insertion_point(builder_scope:test.MyData) |
|
} |
|
|
|
static { |
|
defaultInstance = new MyData(true); |
|
defaultInstance.initFields(); |
|
} |
|
|
|
// @@protoc_insertion_point(class_scope:test.MyData) |
|
} |
|
|
|
private static final com.google.protobuf.Descriptors.Descriptor |
|
internal_static_test_TestMessage_descriptor; |
|
private static |
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable |
|
internal_static_test_TestMessage_fieldAccessorTable; |
|
private static final com.google.protobuf.Descriptors.Descriptor |
|
internal_static_test_MyData_descriptor; |
|
private static |
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable |
|
internal_static_test_MyData_fieldAccessorTable; |
|
|
|
public static com.google.protobuf.Descriptors.FileDescriptor |
|
getDescriptor() { |
|
return descriptor; |
|
} |
|
private static com.google.protobuf.Descriptors.FileDescriptor |
|
descriptor; |
|
static { |
|
java.lang.String[] descriptorData = { |
|
"\n\032src/main/proto/test2.proto\022\004test\")\n\013Te" + |
|
"stMessage\022\032\n\004data\030\001 \001(\0132\014.test.MyData\"\010\n" + |
|
"\006MyData" |
|
}; |
|
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = |
|
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { |
|
public com.google.protobuf.ExtensionRegistry assignDescriptors( |
|
com.google.protobuf.Descriptors.FileDescriptor root) { |
|
descriptor = root; |
|
return null; |
|
} |
|
}; |
|
com.google.protobuf.Descriptors.FileDescriptor |
|
.internalBuildGeneratedFileFrom(descriptorData, |
|
new com.google.protobuf.Descriptors.FileDescriptor[] { |
|
}, assigner); |
|
internal_static_test_TestMessage_descriptor = |
|
getDescriptor().getMessageTypes().get(0); |
|
internal_static_test_TestMessage_fieldAccessorTable = new |
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable( |
|
internal_static_test_TestMessage_descriptor, |
|
new java.lang.String[] { "Data", }); |
|
internal_static_test_MyData_descriptor = |
|
getDescriptor().getMessageTypes().get(1); |
|
internal_static_test_MyData_fieldAccessorTable = new |
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable( |
|
internal_static_test_MyData_descriptor, |
|
new java.lang.String[] { }); |
|
} |
|
|
|
// @@protoc_insertion_point(outer_class_scope) |
|
} |
Nice comments. I've been looking into defaults behavior and I came across this gist.
Looks like your comment about unset message fields being
null
is out of date. The current documentation says:I know for C++, Java and Python, a default value is provided. I would suspect similar behavior from other language implementations.