<PackageReference Include="Google.Protobuf" Version="3.34.2" />

Google.Protobuf.Reflection.EnumValueDescriptor

public sealed class EnumValueDescriptor : DescriptorBase
Descriptor for a single enum value within an enum in a .proto file.
public CustomOptions CustomOptions { get; }

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

Returns the enum descriptor that this value is part of.

public int Number { get; }

Returns the number associated with this enum value.

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

Gets a single value enum value option for this descriptor

Gets a repeated value enum value option for this descriptor

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 a clone of the underlying EnumValueDescriptorProto describing this enum value. Note that a copy is taken every time this method is called, so clients using it frequently (and not modifying it) may want to cache the returned value.