public static final class EnumValue.Builder extends GeneratedMessageV3.Builder<EnumValue.Builder> implements EnumValueOrBuilder
Enum value definition.Protobuf type
google.protobuf.EnumValue
Modifier and Type | Method and Description |
---|---|
EnumValue.Builder |
addAllOptions(Iterable<? extends Option> values)
Protocol buffer options.
|
EnumValue.Builder |
addOptions(int index,
Option.Builder builderForValue)
Protocol buffer options.
|
EnumValue.Builder |
addOptions(int index,
Option value)
Protocol buffer options.
|
EnumValue.Builder |
addOptions(Option.Builder builderForValue)
Protocol buffer options.
|
EnumValue.Builder |
addOptions(Option value)
Protocol buffer options.
|
Option.Builder |
addOptionsBuilder()
Protocol buffer options.
|
Option.Builder |
addOptionsBuilder(int index)
Protocol buffer options.
|
EnumValue.Builder |
addRepeatedField(Descriptors.FieldDescriptor field,
Object value)
Like
setRepeatedField , but appends the value as a new element. |
EnumValue |
build()
Constructs the message based on the state of the Builder.
|
EnumValue |
buildPartial()
Like
MessageLite.Builder.build() , but does not throw an exception if the message is missing required
fields. |
EnumValue.Builder |
clear()
Called by the initialization and clear code paths to allow subclasses to
reset any of their builtin fields back to the initial values.
|
EnumValue.Builder |
clearField(Descriptors.FieldDescriptor field)
Clears the field.
|
EnumValue.Builder |
clearName()
Enum value name.
|
EnumValue.Builder |
clearNumber()
Enum value number.
|
EnumValue.Builder |
clearOneof(Descriptors.OneofDescriptor oneof)
TODO(jieluo): Clear it when all subclasses have implemented this method.
|
EnumValue.Builder |
clearOptions()
Protocol buffer options.
|
EnumValue.Builder |
clone()
Clones the Builder.
|
EnumValue |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
static Descriptors.Descriptor |
getDescriptor() |
Descriptors.Descriptor |
getDescriptorForType()
Get the message's type's descriptor.
|
String |
getName()
Enum value name.
|
ByteString |
getNameBytes()
Enum value name.
|
int |
getNumber()
Enum value number.
|
Option |
getOptions(int index)
Protocol buffer options.
|
Option.Builder |
getOptionsBuilder(int index)
Protocol buffer options.
|
List<Option.Builder> |
getOptionsBuilderList()
Protocol buffer options.
|
int |
getOptionsCount()
Protocol buffer options.
|
List<Option> |
getOptionsList()
Protocol buffer options.
|
OptionOrBuilder |
getOptionsOrBuilder(int index)
Protocol buffer options.
|
List<? extends OptionOrBuilder> |
getOptionsOrBuilderList()
Protocol buffer options.
|
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable()
Get the FieldAccessorTable for this type.
|
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded messages are set, false
otherwise.
|
EnumValue.Builder |
mergeFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry)
Like
MessageLite.Builder.mergeFrom(CodedInputStream) , but also parses extensions. |
EnumValue.Builder |
mergeFrom(EnumValue other) |
EnumValue.Builder |
mergeFrom(Message other)
Merge
other into the message being built. |
EnumValue.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
Merge some unknown fields into the
UnknownFieldSet for this message. |
EnumValue.Builder |
removeOptions(int index)
Protocol buffer options.
|
EnumValue.Builder |
setField(Descriptors.FieldDescriptor field,
Object value)
Sets a field to the given value.
|
EnumValue.Builder |
setName(String value)
Enum value name.
|
EnumValue.Builder |
setNameBytes(ByteString value)
Enum value name.
|
EnumValue.Builder |
setNumber(int value)
Enum value number.
|
EnumValue.Builder |
setOptions(int index,
Option.Builder builderForValue)
Protocol buffer options.
|
EnumValue.Builder |
setOptions(int index,
Option value)
Protocol buffer options.
|
EnumValue.Builder |
setRepeatedField(Descriptors.FieldDescriptor field,
int index,
Object value)
Sets an element of a repeated field to the given value.
|
EnumValue.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
Set the
UnknownFieldSet for this message. |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
GeneratedMessageV3.Builder
internalGetFieldAccessorTable
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public EnumValue.Builder clear()
GeneratedMessageV3.Builder
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public Descriptors.Descriptor getDescriptorForType()
Message.Builder
MessageOrBuilder.getDescriptorForType()
.getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public EnumValue getDefaultInstanceForType()
MessageLiteOrBuilder
getDefaultInstance()
method of generated
message classes in that this method is an abstract method of the MessageLite
interface
whereas getDefaultInstance()
is a static method of a specific class. They return the
same thing.getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public EnumValue build()
MessageLite.Builder
build
in interface Message.Builder
build
in interface MessageLite.Builder
public EnumValue buildPartial()
MessageLite.Builder
MessageLite.Builder.build()
, but does not throw an exception if the message is missing required
fields. Instead, a partial message is returned. Subsequent changes to the Builder will not
affect the returned message.buildPartial
in interface Message.Builder
buildPartial
in interface MessageLite.Builder
public EnumValue.Builder clone()
MessageLite.Builder
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class GeneratedMessageV3.Builder<EnumValue.Builder>
Object.clone()
public EnumValue.Builder setField(Descriptors.FieldDescriptor field, Object value)
Message.Builder
MessageOrBuilder.getField(Descriptors.FieldDescriptor)
would return.setField
in interface Message.Builder
setField
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public EnumValue.Builder clearField(Descriptors.FieldDescriptor field)
Message.Builder
clearField
in interface Message.Builder
clearField
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public EnumValue.Builder clearOneof(Descriptors.OneofDescriptor oneof)
AbstractMessage.Builder
clearOneof
in interface Message.Builder
clearOneof
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public EnumValue.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Message.Builder
MessageOrBuilder.getRepeatedField(Descriptors.FieldDescriptor,int)
would return.setRepeatedField
in interface Message.Builder
setRepeatedField
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public EnumValue.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Message.Builder
setRepeatedField
, but appends the value as a new element.addRepeatedField
in interface Message.Builder
addRepeatedField
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public EnumValue.Builder mergeFrom(Message other)
Message.Builder
other
into the message being built. other
must have the exact same type
as this
(i.e. getDescriptorForType() == other.getDescriptorForType()
).
Merging occurs as follows. For each field:
* For singular primitive fields, if the field is set in other
, then other
's
value overwrites the value in this message.
* For singular message fields, if the field is set in other
, it is merged into the
corresponding sub-message of this message using the same merging rules.
* For repeated fields, the elements in other
are concatenated with the elements in
this message.
* For oneof groups, if the other message has one of the fields set, the group of this message
is cleared and replaced by the field of the other message, so that the oneof constraint is
preserved.
This is equivalent to the Message::MergeFrom
method in C++.
mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<EnumValue.Builder>
public EnumValue.Builder mergeFrom(EnumValue other)
public final boolean isInitialized()
MessageLiteOrBuilder
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public EnumValue.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
MessageLite.Builder
MessageLite.Builder.mergeFrom(CodedInputStream)
, but also parses extensions. The extensions
that you want to be able to parse must be registered in extensionRegistry
. Extensions
not in the registry will be treated as unknown fields.mergeFrom
in interface Message.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<EnumValue.Builder>
IOException
public String getName()
Enum value name.
string name = 1;
getName
in interface EnumValueOrBuilder
public ByteString getNameBytes()
Enum value name.
string name = 1;
getNameBytes
in interface EnumValueOrBuilder
public EnumValue.Builder setName(String value)
Enum value name.
string name = 1;
value
- The name to set.public EnumValue.Builder clearName()
Enum value name.
string name = 1;
public EnumValue.Builder setNameBytes(ByteString value)
Enum value name.
string name = 1;
value
- The bytes for name to set.public int getNumber()
Enum value number.
int32 number = 2;
getNumber
in interface EnumValueOrBuilder
public EnumValue.Builder setNumber(int value)
Enum value number.
int32 number = 2;
value
- The number to set.public EnumValue.Builder clearNumber()
Enum value number.
int32 number = 2;
public List<Option> getOptionsList()
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
getOptionsList
in interface EnumValueOrBuilder
public int getOptionsCount()
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
getOptionsCount
in interface EnumValueOrBuilder
public Option getOptions(int index)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
getOptions
in interface EnumValueOrBuilder
public EnumValue.Builder setOptions(int index, Option value)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public EnumValue.Builder setOptions(int index, Option.Builder builderForValue)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public EnumValue.Builder addOptions(Option value)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public EnumValue.Builder addOptions(int index, Option value)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public EnumValue.Builder addOptions(Option.Builder builderForValue)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public EnumValue.Builder addOptions(int index, Option.Builder builderForValue)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public EnumValue.Builder addAllOptions(Iterable<? extends Option> values)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public EnumValue.Builder clearOptions()
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public EnumValue.Builder removeOptions(int index)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public Option.Builder getOptionsBuilder(int index)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public OptionOrBuilder getOptionsOrBuilder(int index)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
getOptionsOrBuilder
in interface EnumValueOrBuilder
public List<? extends OptionOrBuilder> getOptionsOrBuilderList()
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
getOptionsOrBuilderList
in interface EnumValueOrBuilder
public Option.Builder addOptionsBuilder()
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public Option.Builder addOptionsBuilder(int index)
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public List<Option.Builder> getOptionsBuilderList()
Protocol buffer options.
repeated .google.protobuf.Option options = 3;
public final EnumValue.Builder setUnknownFields(UnknownFieldSet unknownFields)
Message.Builder
UnknownFieldSet
for this message.setUnknownFields
in interface Message.Builder
setUnknownFields
in class GeneratedMessageV3.Builder<EnumValue.Builder>
public final EnumValue.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Message.Builder
UnknownFieldSet
for this message.mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessageV3.Builder<EnumValue.Builder>
Copyright © 2008–2020. All rights reserved.