Package com.google.protobuf
Class Descriptors.EnumValueDescriptor
- java.lang.Object
-
- com.google.protobuf.Descriptors.GenericDescriptor
-
- com.google.protobuf.Descriptors.EnumValueDescriptor
-
- All Implemented Interfaces:
Internal.EnumLite
- Enclosing class:
- Descriptors
public static final class Descriptors.EnumValueDescriptor extends Descriptors.GenericDescriptor implements Internal.EnumLite
Describes one value within an enum type. Note that multiple defined values may have the same number. In generated Java code, all values with the same number after the first become aliases of the first. However, they still have independent EnumValueDescriptors.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.util.Comparator<Descriptors.EnumValueDescriptor>BY_NUMBERprivate java.lang.StringfullNameprivate intindex(package private) static Descriptors.NumberGetter<Descriptors.EnumValueDescriptor>NUMBER_GETTERprivate DescriptorProtos.EnumValueOptionsoptionsprivate DescriptorProtos.EnumValueDescriptorProtoprotoprivate Descriptors.EnumDescriptortype-
Fields inherited from class com.google.protobuf.Descriptors.GenericDescriptor
features, parent
-
-
Constructor Summary
Constructors Modifier Constructor Description privateEnumValueDescriptor(DescriptorProtos.EnumValueDescriptorProto proto, Descriptors.FileDescriptor file, Descriptors.EnumDescriptor parent, int index)privateEnumValueDescriptor(Descriptors.EnumDescriptor parent, java.lang.Integer number)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Descriptors.FileDescriptorgetFile()Get theDescriptors.FileDescriptorcontaining this descriptor.java.lang.StringgetFullName()Get the value's fully-qualified name.intgetIndex()Get the index of this descriptor within its parent.java.lang.StringgetName()Get the value's unqualified name.intgetNumber()Get the value's number.DescriptorProtos.EnumValueOptionsgetOptions()Get theEnumValueOptions, defined indescriptor.proto.Descriptors.EnumDescriptorgetType()Get the value's enum type.private voidresolveAllFeatures()SeeFileDescriptor#resolveAllFeatures.private voidsetProto(DescriptorProtos.EnumValueDescriptorProto proto)DescriptorProtos.EnumValueDescriptorPrototoProto()Convert the descriptor to its protocol message representation.java.lang.StringtoString()-
Methods inherited from class com.google.protobuf.Descriptors.GenericDescriptor
getFeatures, hasInferredLegacyProtoFeatures, inferLegacyProtoFeatures, resolveFeatures, validateFeatures
-
-
-
-
Field Detail
-
BY_NUMBER
static final java.util.Comparator<Descriptors.EnumValueDescriptor> BY_NUMBER
-
NUMBER_GETTER
static final Descriptors.NumberGetter<Descriptors.EnumValueDescriptor> NUMBER_GETTER
-
index
private final int index
-
proto
private DescriptorProtos.EnumValueDescriptorProto proto
-
options
private volatile DescriptorProtos.EnumValueOptions options
-
fullName
private final java.lang.String fullName
-
type
private final Descriptors.EnumDescriptor type
-
-
Constructor Detail
-
EnumValueDescriptor
private EnumValueDescriptor(DescriptorProtos.EnumValueDescriptorProto proto, Descriptors.FileDescriptor file, Descriptors.EnumDescriptor parent, int index) throws Descriptors.DescriptorValidationException
-
EnumValueDescriptor
private EnumValueDescriptor(Descriptors.EnumDescriptor parent, java.lang.Integer number)
-
-
Method Detail
-
getIndex
public int getIndex()
Get the index of this descriptor within its parent.- See Also:
Descriptors.Descriptor.getIndex()
-
toProto
public DescriptorProtos.EnumValueDescriptorProto toProto()
Convert the descriptor to its protocol message representation.- Specified by:
toProtoin classDescriptors.GenericDescriptor
-
getName
public java.lang.String getName()
Get the value's unqualified name.- Specified by:
getNamein classDescriptors.GenericDescriptor
-
getNumber
public int getNumber()
Get the value's number.- Specified by:
getNumberin interfaceInternal.EnumLite
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getFullName
public java.lang.String getFullName()
Get the value's fully-qualified name.- Specified by:
getFullNamein classDescriptors.GenericDescriptor- See Also:
Descriptors.Descriptor.getFullName()
-
getFile
public Descriptors.FileDescriptor getFile()
Get theDescriptors.FileDescriptorcontaining this descriptor.- Specified by:
getFilein classDescriptors.GenericDescriptor
-
getType
public Descriptors.EnumDescriptor getType()
Get the value's enum type.
-
getOptions
public DescriptorProtos.EnumValueOptions getOptions()
Get theEnumValueOptions, defined indescriptor.proto.
-
resolveAllFeatures
private void resolveAllFeatures() throws Descriptors.DescriptorValidationExceptionSeeFileDescriptor#resolveAllFeatures.
-
setProto
private void setProto(DescriptorProtos.EnumValueDescriptorProto proto) throws Descriptors.DescriptorValidationException
-
-