proto library Client - Class Option (v5.36.2)

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

A protocol buffer option, which can be attached to a message, field, enumeration, etc.

New usages of this message as an alternative to FileOptions, MessageOptions, FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions are strongly discouraged.

Generated from protobuf message google.protobuf.Option

Namespace

Google \ Protobuf

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

The option's name. For protobuf built-in options (options defined in descriptor.proto), this is the short name. For example, "map_entry". For custom options, it should be the fully-qualified name. For example, "google.api.http".

↳ value Any

The option's value packed in an Any message. If the value is a primitive, the corresponding wrapper type defined in google/protobuf/wrappers.proto should be used. If the value is an enum, it should be stored as an int32 value using the google.protobuf.Int32Value type.

getName

The option's name. For protobuf built-in options (options defined in descriptor.proto), this is the short name. For example, "map_entry".

For custom options, it should be the fully-qualified name. For example, "google.api.http".

Returns
Type Description
string

setName

The option's name. For protobuf built-in options (options defined in descriptor.proto), this is the short name. For example, "map_entry".

For custom options, it should be the fully-qualified name. For example, "google.api.http".

Parameter
Name Description
var string
Returns
Type Description
$this

getValue

The option's value packed in an Any message. If the value is a primitive, the corresponding wrapper type defined in google/protobuf/wrappers.proto should be used. If the value is an enum, it should be stored as an int32 value using the google.protobuf.Int32Value type.

Returns
Type Description
Any|null

hasValue

clearValue

setValue

The option's value packed in an Any message. If the value is a primitive, the corresponding wrapper type defined in google/protobuf/wrappers.proto should be used. If the value is an enum, it should be stored as an int32 value using the google.protobuf.Int32Value type.

Parameter
Name Description
var Any
Returns
Type Description
$this