// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/unittest_embed_optimize_for.proto
package protobuf_unittest;
public final class UnittestEmbedOptimizeFor {
private UnittestEmbedOptimizeFor() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface TestEmbedOptimizedForSizeOrBuilder extends
// @@protoc_insertion_point(interface_extends:protobuf_unittest.TestEmbedOptimizedForSize)
com.google.protobuf.MessageOrBuilder {
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
boolean hasOptionalMessage();
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize getOptionalMessage();
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder getOptionalMessageOrBuilder();
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
java.util.List<protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize>
getRepeatedMessageList();
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize getRepeatedMessage(int index);
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
int getRepeatedMessageCount();
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
java.util.List<? extends protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder>
getRepeatedMessageOrBuilderList();
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder getRepeatedMessageOrBuilder(
int index);
}
/**
* Protobuf type {@code protobuf_unittest.TestEmbedOptimizedForSize}
*/
public static final class TestEmbedOptimizedForSize extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:protobuf_unittest.TestEmbedOptimizedForSize)
TestEmbedOptimizedForSizeOrBuilder {
// Use TestEmbedOptimizedForSize.newBuilder() to construct.
private TestEmbedOptimizedForSize(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private TestEmbedOptimizedForSize(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final TestEmbedOptimizedForSize defaultInstance;
public static TestEmbedOptimizedForSize getDefaultInstance() {
return defaultInstance;
}
public TestEmbedOptimizedForSize getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TestEmbedOptimizedForSize(
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: {
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder subBuilder = null;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
subBuilder = optionalMessage_.toBuilder();
}
optionalMessage_ = input.readMessage(protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(optionalMessage_);
optionalMessage_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000001;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
repeatedMessage_ = new java.util.ArrayList<protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize>();
mutable_bitField0_ |= 0x00000002;
}
repeatedMessage_.add(input.readMessage(protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.PARSER, extensionRegistry));
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 {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
repeatedMessage_ = java.util.Collections.unmodifiableList(repeatedMessage_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return protobuf_unittest.UnittestEmbedOptimizeFor.internal_static_protobuf_unittest_TestEmbedOptimizedForSize_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return protobuf_unittest.UnittestEmbedOptimizeFor.internal_static_protobuf_unittest_TestEmbedOptimizedForSize_fieldAccessorTable
.ensureFieldAccessorsInitialized(
protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize.class, protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize.Builder.class);
}
public static com.google.protobuf.Parser<TestEmbedOptimizedForSize> PARSER =
new com.google.protobuf.AbstractParser<TestEmbedOptimizedForSize>() {
public TestEmbedOptimizedForSize parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TestEmbedOptimizedForSize(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<TestEmbedOptimizedForSize> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int OPTIONAL_MESSAGE_FIELD_NUMBER = 1;
private protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize optionalMessage_;
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public boolean hasOptionalMessage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize getOptionalMessage() {
return optionalMessage_;
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder getOptionalMessageOrBuilder() {
return optionalMessage_;
}
public static final int REPEATED_MESSAGE_FIELD_NUMBER = 2;
private java.util.List<protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize> repeatedMessage_;
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public java.util.List<protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize> getRepeatedMessageList() {
return repeatedMessage_;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public java.util.List<? extends protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder>
getRepeatedMessageOrBuilderList() {
return repeatedMessage_;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public int getRepeatedMessageCount() {
return repeatedMessage_.size();
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize getRepeatedMessage(int index) {
return repeatedMessage_.get(index);
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder getRepeatedMessageOrBuilder(
int index) {
return repeatedMessage_.get(index);
}
private void initFields() {
optionalMessage_ = protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.getDefaultInstance();
repeatedMessage_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (hasOptionalMessage()) {
if (!getOptionalMessage().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
for (int i = 0; i < getRepeatedMessageCount(); i++) {
if (!getRepeatedMessage(i).isInitialized()) {
memoizedIsInitialized = 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, optionalMessage_);
}
for (int i = 0; i < repeatedMessage_.size(); i++) {
output.writeMessage(2, repeatedMessage_.get(i));
}
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, optionalMessage_);
}
for (int i = 0; i < repeatedMessage_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, repeatedMessage_.get(i));
}
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 protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize 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(protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize 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 protobuf_unittest.TestEmbedOptimizedForSize}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:protobuf_unittest.TestEmbedOptimizedForSize)
protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSizeOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return protobuf_unittest.UnittestEmbedOptimizeFor.internal_static_protobuf_unittest_TestEmbedOptimizedForSize_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return protobuf_unittest.UnittestEmbedOptimizeFor.internal_static_protobuf_unittest_TestEmbedOptimizedForSize_fieldAccessorTable
.ensureFieldAccessorsInitialized(
protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize.class, protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize.Builder.class);
}
// Construct using protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getOptionalMessageFieldBuilder();
getRepeatedMessageFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
if (optionalMessageBuilder_ == null) {
optionalMessage_ = protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.getDefaultInstance();
} else {
optionalMessageBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
if (repeatedMessageBuilder_ == null) {
repeatedMessage_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
repeatedMessageBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return protobuf_unittest.UnittestEmbedOptimizeFor.internal_static_protobuf_unittest_TestEmbedOptimizedForSize_descriptor;
}
public protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize getDefaultInstanceForType() {
return protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize.getDefaultInstance();
}
public protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize build() {
protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize buildPartial() {
protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize result = new protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
if (optionalMessageBuilder_ == null) {
result.optionalMessage_ = optionalMessage_;
} else {
result.optionalMessage_ = optionalMessageBuilder_.build();
}
if (repeatedMessageBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
repeatedMessage_ = java.util.Collections.unmodifiableList(repeatedMessage_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.repeatedMessage_ = repeatedMessage_;
} else {
result.repeatedMessage_ = repeatedMessageBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize) {
return mergeFrom((protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize other) {
if (other == protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize.getDefaultInstance()) return this;
if (other.hasOptionalMessage()) {
mergeOptionalMessage(other.getOptionalMessage());
}
if (repeatedMessageBuilder_ == null) {
if (!other.repeatedMessage_.isEmpty()) {
if (repeatedMessage_.isEmpty()) {
repeatedMessage_ = other.repeatedMessage_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureRepeatedMessageIsMutable();
repeatedMessage_.addAll(other.repeatedMessage_);
}
onChanged();
}
} else {
if (!other.repeatedMessage_.isEmpty()) {
if (repeatedMessageBuilder_.isEmpty()) {
repeatedMessageBuilder_.dispose();
repeatedMessageBuilder_ = null;
repeatedMessage_ = other.repeatedMessage_;
bitField0_ = (bitField0_ & ~0x00000002);
repeatedMessageBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getRepeatedMessageFieldBuilder() : null;
} else {
repeatedMessageBuilder_.addAllMessages(other.repeatedMessage_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (hasOptionalMessage()) {
if (!getOptionalMessage().isInitialized()) {
return false;
}
}
for (int i = 0; i < getRepeatedMessageCount(); i++) {
if (!getRepeatedMessage(i).isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (protobuf_unittest.UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize optionalMessage_ = protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder> optionalMessageBuilder_;
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public boolean hasOptionalMessage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize getOptionalMessage() {
if (optionalMessageBuilder_ == null) {
return optionalMessage_;
} else {
return optionalMessageBuilder_.getMessage();
}
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public Builder setOptionalMessage(protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize value) {
if (optionalMessageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
optionalMessage_ = value;
onChanged();
} else {
optionalMessageBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public Builder setOptionalMessage(
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder builderForValue) {
if (optionalMessageBuilder_ == null) {
optionalMessage_ = builderForValue.build();
onChanged();
} else {
optionalMessageBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public Builder mergeOptionalMessage(protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize value) {
if (optionalMessageBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001) &&
optionalMessage_ != protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.getDefaultInstance()) {
optionalMessage_ =
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.newBuilder(optionalMessage_).mergeFrom(value).buildPartial();
} else {
optionalMessage_ = value;
}
onChanged();
} else {
optionalMessageBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public Builder clearOptionalMessage() {
if (optionalMessageBuilder_ == null) {
optionalMessage_ = protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.getDefaultInstance();
onChanged();
} else {
optionalMessageBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder getOptionalMessageBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getOptionalMessageFieldBuilder().getBuilder();
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder getOptionalMessageOrBuilder() {
if (optionalMessageBuilder_ != null) {
return optionalMessageBuilder_.getMessageOrBuilder();
} else {
return optionalMessage_;
}
}
/**
* <code>optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;</code>
*
* <pre>
* Test that embedding a message which has optimize_for = CODE_SIZE into
* one optimized for speed works.
* </pre>
*/
private com.google.protobuf.SingleFieldBuilder<
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder>
getOptionalMessageFieldBuilder() {
if (optionalMessageBuilder_ == null) {
optionalMessageBuilder_ = new com.google.protobuf.SingleFieldBuilder<
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder>(
getOptionalMessage(),
getParentForChildren(),
isClean());
optionalMessage_ = null;
}
return optionalMessageBuilder_;
}
private java.util.List<protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize> repeatedMessage_ =
java.util.Collections.emptyList();
private void ensureRepeatedMessageIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
repeatedMessage_ = new java.util.ArrayList<protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize>(repeatedMessage_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder> repeatedMessageBuilder_;
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public java.util.List<protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize> getRepeatedMessageList() {
if (repeatedMessageBuilder_ == null) {
return java.util.Collections.unmodifiableList(repeatedMessage_);
} else {
return repeatedMessageBuilder_.getMessageList();
}
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public int getRepeatedMessageCount() {
if (repeatedMessageBuilder_ == null) {
return repeatedMessage_.size();
} else {
return repeatedMessageBuilder_.getCount();
}
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize getRepeatedMessage(int index) {
if (repeatedMessageBuilder_ == null) {
return repeatedMessage_.get(index);
} else {
return repeatedMessageBuilder_.getMessage(index);
}
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public Builder setRepeatedMessage(
int index, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize value) {
if (repeatedMessageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRepeatedMessageIsMutable();
repeatedMessage_.set(index, value);
onChanged();
} else {
repeatedMessageBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public Builder setRepeatedMessage(
int index, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder builderForValue) {
if (repeatedMessageBuilder_ == null) {
ensureRepeatedMessageIsMutable();
repeatedMessage_.set(index, builderForValue.build());
onChanged();
} else {
repeatedMessageBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public Builder addRepeatedMessage(protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize value) {
if (repeatedMessageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRepeatedMessageIsMutable();
repeatedMessage_.add(value);
onChanged();
} else {
repeatedMessageBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public Builder addRepeatedMessage(
int index, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize value) {
if (repeatedMessageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRepeatedMessageIsMutable();
repeatedMessage_.add(index, value);
onChanged();
} else {
repeatedMessageBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public Builder addRepeatedMessage(
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder builderForValue) {
if (repeatedMessageBuilder_ == null) {
ensureRepeatedMessageIsMutable();
repeatedMessage_.add(builderForValue.build());
onChanged();
} else {
repeatedMessageBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public Builder addRepeatedMessage(
int index, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder builderForValue) {
if (repeatedMessageBuilder_ == null) {
ensureRepeatedMessageIsMutable();
repeatedMessage_.add(index, builderForValue.build());
onChanged();
} else {
repeatedMessageBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public Builder addAllRepeatedMessage(
java.lang.Iterable<? extends protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize> values) {
if (repeatedMessageBuilder_ == null) {
ensureRepeatedMessageIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, repeatedMessage_);
onChanged();
} else {
repeatedMessageBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public Builder clearRepeatedMessage() {
if (repeatedMessageBuilder_ == null) {
repeatedMessage_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
repeatedMessageBuilder_.clear();
}
return this;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public Builder removeRepeatedMessage(int index) {
if (repeatedMessageBuilder_ == null) {
ensureRepeatedMessageIsMutable();
repeatedMessage_.remove(index);
onChanged();
} else {
repeatedMessageBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder getRepeatedMessageBuilder(
int index) {
return getRepeatedMessageFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder getRepeatedMessageOrBuilder(
int index) {
if (repeatedMessageBuilder_ == null) {
return repeatedMessage_.get(index); } else {
return repeatedMessageBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public java.util.List<? extends protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder>
getRepeatedMessageOrBuilderList() {
if (repeatedMessageBuilder_ != null) {
return repeatedMessageBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(repeatedMessage_);
}
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder addRepeatedMessageBuilder() {
return getRepeatedMessageFieldBuilder().addBuilder(
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.getDefaultInstance());
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder addRepeatedMessageBuilder(
int index) {
return getRepeatedMessageFieldBuilder().addBuilder(
index, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.getDefaultInstance());
}
/**
* <code>repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;</code>
*/
public java.util.List<protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder>
getRepeatedMessageBuilderList() {
return getRepeatedMessageFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder>
getRepeatedMessageFieldBuilder() {
if (repeatedMessageBuilder_ == null) {
repeatedMessageBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize.Builder, protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSizeOrBuilder>(
repeatedMessage_,
((bitField0_ & 0x00000002) == 0x00000002),
getParentForChildren(),
isClean());
repeatedMessage_ = null;
}
return repeatedMessageBuilder_;
}
// @@protoc_insertion_point(builder_scope:protobuf_unittest.TestEmbedOptimizedForSize)
}
static {
defaultInstance = new TestEmbedOptimizedForSize(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:protobuf_unittest.TestEmbedOptimizedForSize)
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_protobuf_unittest_TestEmbedOptimizedForSize_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_protobuf_unittest_TestEmbedOptimizedForSize_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n1google/protobuf/unittest_embed_optimiz" +
"e_for.proto\022\021protobuf_unittest\032+google/p" +
"rotobuf/unittest_optimize_for.proto\"\241\001\n\031" +
"TestEmbedOptimizedForSize\022A\n\020optional_me" +
"ssage\030\001 \001(\0132\'.protobuf_unittest.TestOpti" +
"mizedForSize\022A\n\020repeated_message\030\002 \003(\0132\'" +
".protobuf_unittest.TestOptimizedForSizeB" +
"\002H\001"
};
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[] {
protobuf_unittest.UnittestOptimizeFor.getDescriptor(),
}, assigner);
internal_static_protobuf_unittest_TestEmbedOptimizedForSize_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_protobuf_unittest_TestEmbedOptimizedForSize_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_protobuf_unittest_TestEmbedOptimizedForSize_descriptor,
new java.lang.String[] { "OptionalMessage", "RepeatedMessage", });
protobuf_unittest.UnittestOptimizeFor.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}