Class DescriptorProtos.EnumValueDescriptorProto.Builder (3.19.4)

public static final class DescriptorProtos.EnumValueDescriptorProto.Builder extends GeneratedMessageV3.Builder<DescriptorProtos.EnumValueDescriptorProto.Builder> implements DescriptorProtos.EnumValueDescriptorProtoOrBuilder

Describes a value within an enum.

Protobuf type google.protobuf.EnumValueDescriptorProto

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptors.Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.EnumValueDescriptorProto.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
valueObject
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides

build()

public DescriptorProtos.EnumValueDescriptorProto build()
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto

buildPartial()

public DescriptorProtos.EnumValueDescriptorProto buildPartial()
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto

clear()

public DescriptorProtos.EnumValueDescriptorProto.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.

Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public DescriptorProtos.EnumValueDescriptorProto.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldDescriptors.FieldDescriptor
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides

clearName()

public DescriptorProtos.EnumValueDescriptorProto.Builder clearName()

optional string name = 1;

Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

This builder for chaining.

clearNumber()

public DescriptorProtos.EnumValueDescriptorProto.Builder clearNumber()

optional int32 number = 2;

Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public DescriptorProtos.EnumValueDescriptorProto.Builder clearOneof(Descriptors.OneofDescriptor oneof)

TODO(jieluo): Clear it when all subclasses have implemented this method.

Parameter
NameDescription
oneofDescriptors.OneofDescriptor
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides

clearOptions()

public DescriptorProtos.EnumValueDescriptorProto.Builder clearOptions()

optional .google.protobuf.EnumValueOptions options = 3;

Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

clone()

public DescriptorProtos.EnumValueDescriptorProto.Builder clone()

Clones the Builder.

Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides

getDefaultInstanceForType()

public DescriptorProtos.EnumValueDescriptorProto getDefaultInstanceForType()

Get an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from the 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.

Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()

Get the message's type's descriptor. This differs from the getDescriptor() method of generated message classes in that this method is an abstract method of the Message interface whereas getDescriptor() is a static method of a specific class. They return the same thing.

Returns
TypeDescription
Descriptors.Descriptor
Overrides

getName()

public String getName()

optional string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

optional string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getNumber()

public int getNumber()

optional int32 number = 2;

Returns
TypeDescription
int

The number.

getOptions()

public DescriptorProtos.EnumValueOptions getOptions()

optional .google.protobuf.EnumValueOptions options = 3;

Returns
TypeDescription
DescriptorProtos.EnumValueOptions

The options.

getOptionsBuilder()

public DescriptorProtos.EnumValueOptions.Builder getOptionsBuilder()

optional .google.protobuf.EnumValueOptions options = 3;

Returns
TypeDescription
DescriptorProtos.EnumValueOptions.Builder

getOptionsOrBuilder()

public DescriptorProtos.EnumValueOptionsOrBuilder getOptionsOrBuilder()

optional .google.protobuf.EnumValueOptions options = 3;

Returns
TypeDescription
DescriptorProtos.EnumValueOptionsOrBuilder

hasName()

public boolean hasName()

optional string name = 1;

Returns
TypeDescription
boolean

Whether the name field is set.

hasNumber()

public boolean hasNumber()

optional int32 number = 2;

Returns
TypeDescription
boolean

Whether the number field is set.

hasOptions()

public boolean hasOptions()

optional .google.protobuf.EnumValueOptions options = 3;

Returns
TypeDescription
boolean

Whether the options field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()

Get the FieldAccessorTable for this type. We can't have the message class pass this in to the constructor because of bootstrapping trouble with DescriptorProtos.

Returns
TypeDescription
GeneratedMessageV3.FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()

Returns true if all required fields in the message and all embedded messages are set, false otherwise.

See also: MessageOrBuilder#getInitializationErrorString()

Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public DescriptorProtos.EnumValueDescriptorProto.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

Like 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.

Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(DescriptorProtos.EnumValueDescriptorProto other)

public DescriptorProtos.EnumValueDescriptorProto.Builder mergeFrom(DescriptorProtos.EnumValueDescriptorProto other)
Parameter
NameDescription
otherDescriptorProtos.EnumValueDescriptorProto
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

mergeFrom(Message other)

public DescriptorProtos.EnumValueDescriptorProto.Builder mergeFrom(Message other)

Merge 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++.

Parameter
NameDescription
otherMessage
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides

mergeOptions(DescriptorProtos.EnumValueOptions value)

public DescriptorProtos.EnumValueDescriptorProto.Builder mergeOptions(DescriptorProtos.EnumValueOptions value)

optional .google.protobuf.EnumValueOptions options = 3;

Parameter
NameDescription
valueDescriptorProtos.EnumValueOptions
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.EnumValueDescriptorProto.Builder mergeUnknownFields(UnknownFieldSet unknownFields)

Merge some unknown fields into the UnknownFieldSet for this message.

Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.EnumValueDescriptorProto.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
valueObject
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides

setName(String value)

public DescriptorProtos.EnumValueDescriptorProto.Builder setName(String value)

optional string name = 1;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

This builder for chaining.

setNameBytes(ByteString value)

public DescriptorProtos.EnumValueDescriptorProto.Builder setNameBytes(ByteString value)

optional string name = 1;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

This builder for chaining.

setNumber(int value)

public DescriptorProtos.EnumValueDescriptorProto.Builder setNumber(int value)

optional int32 number = 2;

Parameter
NameDescription
valueint

The number to set.

Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

This builder for chaining.

setOptions(DescriptorProtos.EnumValueOptions value)

public DescriptorProtos.EnumValueDescriptorProto.Builder setOptions(DescriptorProtos.EnumValueOptions value)

optional .google.protobuf.EnumValueOptions options = 3;

Parameter
NameDescription
valueDescriptorProtos.EnumValueOptions
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

setOptions(DescriptorProtos.EnumValueOptions.Builder builderForValue)

public DescriptorProtos.EnumValueDescriptorProto.Builder setOptions(DescriptorProtos.EnumValueOptions.Builder builderForValue)

optional .google.protobuf.EnumValueOptions options = 3;

Parameter
NameDescription
builderForValueDescriptorProtos.EnumValueOptions.Builder
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public DescriptorProtos.EnumValueDescriptorProto.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
indexint
valueObject
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.EnumValueDescriptorProto.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.EnumValueDescriptorProto.Builder
Overrides