Option

interface Option(source)

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.

Properties

Link copied to clipboard
abstract val 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".

Link copied to clipboard

Returns the field-presence view for this Option instance.

Link copied to clipboard
abstract val 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.

Link copied to clipboard

Returns the value of the value field if present, otherwise null.

Functions

Link copied to clipboard
fun Option.copy(body: ERROR CLASS: Symbol not found for Option.Builder.() -> Unit = {}): Option

Copies the original message, including unknown fields.