proto library Client - Class EnumDescriptorProto (v5.36.2)

Reference documentation and code samples for the proto library Client class EnumDescriptorProto.

Describes an enum type.

Generated from protobuf message google.protobuf.EnumDescriptorProto

Namespace

Google \ Protobuf \ Internal

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string
↳ value array<EnumValueDescriptorProto>
↳ options EnumOptions
↳ reserved_range array<EnumDescriptorProto\EnumReservedRange>

Range of reserved numeric values. Reserved numeric values may not be used by enum values in the same enum declaration. Reserved ranges may not overlap.

↳ reserved_name string[]

Reserved enum value names, which may not be reused. A given name may only be reserved once.

↳ visibility int

Support for export and local keywords on enums.

getName

Generated from protobuf field optional string name = 1;

Returns
Type Description
string

hasName

clearName

setName

Generated from protobuf field optional string name = 1;

Parameter
Name Description
var string
Returns
Type Description
$this

getValue

Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2;

Returns
Type Description
Google\Protobuf\RepeatedField<EnumValueDescriptorProto>

setValue

Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2;

Parameter
Name Description
var array<EnumValueDescriptorProto>
Returns
Type Description
$this

getOptions

Generated from protobuf field optional .google.protobuf.EnumOptions options = 3;

Returns
Type Description
EnumOptions|null

hasOptions

clearOptions

setOptions

Generated from protobuf field optional .google.protobuf.EnumOptions options = 3;

Parameter
Name Description
var EnumOptions
Returns
Type Description
$this

getReservedRange

Range of reserved numeric values. Reserved numeric values may not be used by enum values in the same enum declaration. Reserved ranges may not overlap.

Returns
Type Description
Google\Protobuf\RepeatedField<EnumDescriptorProto\EnumReservedRange>

setReservedRange

Range of reserved numeric values. Reserved numeric values may not be used by enum values in the same enum declaration. Reserved ranges may not overlap.

Parameter
Name Description
var array<EnumDescriptorProto\EnumReservedRange>
Returns
Type Description
$this

getReservedName

Reserved enum value names, which may not be reused. A given name may only be reserved once.

Returns
Type Description
Google\Protobuf\RepeatedField<string>

setReservedName

Reserved enum value names, which may not be reused. A given name may only be reserved once.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getVisibility

Support for export and local keywords on enums.

Returns
Type Description
int one of the values in {@see \Google\Protobuf\Internal\SymbolVisibility}

hasVisibility

clearVisibility

setVisibility

Support for export and local keywords on enums.

Parameter
Name Description
var int

one of the values in SymbolVisibility

Returns
Type Description
$this