Class EnumValueDescriptor

public sealed class EnumValueDescriptor : DescriptorBase, IDescriptor

Descriptor for a single enum value within an enum in a .proto file.

Inheritance

Object > DescriptorBase > EnumValueDescriptor

Implements

IDescriptor

Namespace

Google.Protobuf.Reflection

Assembly

Google.Protobuf.dll

Properties

CustomOptions

public CustomOptions CustomOptions { get; }

The (possibly empty) set of custom options for this enum value.

Property Value
TypeDescription
CustomOptions

EnumDescriptor

public EnumDescriptor EnumDescriptor { get; }

Returns the enum descriptor that this value is part of.

Property Value
TypeDescription
EnumDescriptor

Name

public override string Name { get; }

Returns the name of the enum value described by this object.

Property Value
TypeDescription
String
Overrides

Number

public int Number { get; }

Returns the number associated with this enum value.

Property Value
TypeDescription
Int32

Methods

GetOption<T>(Extension<EnumValueOptions, T>)

public T GetOption<T>(Extension<EnumValueOptions, T> extension)

Gets a single value enum value option for this descriptor

Parameter
TypeNameDescription
Extension<EnumValueOptions, T>extension
Returns
TypeDescription
T
Type Parameter
NameDescription
T

GetOption<T>(RepeatedExtension<EnumValueOptions, T>)

public RepeatedField<T> GetOption<T>(RepeatedExtension<EnumValueOptions, T> extension)

Gets a repeated value enum value option for this descriptor

Parameter
TypeNameDescription
RepeatedExtension<EnumValueOptions, T>extension
Returns
TypeDescription
RepeatedField<T>
Type Parameter
NameDescription
T

GetOptions()

public EnumValueOptions GetOptions()

The EnumValueOptions, defined in descriptor.proto. If the options message is not present (i.e. there are no options), null is returned. Custom options can be retrieved as extensions of the returned message. NOTE: A defensive copy is created each time this property is retrieved.

Returns
TypeDescription
EnumValueOptions

Implements