Class Option.Builder

All Implemented Interfaces:
MessageLite.Builder, MessageLiteOrBuilder, OptionOrBuilder, Cloneable
Enclosing class:
Option

public static final class Option.Builder extends GeneratedMessageLite.Builder<Option,Option.Builder> implements OptionOrBuilder
 A protocol buffer option, which can be attached to a message, field,
 enumeration, etc.
 
Protobuf type google.protobuf.Option
  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • getName

      public String 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"`.
       
      string name = 1;
      Specified by:
      getName in interface OptionOrBuilder
      Returns:
      The name.
    • getNameBytes

      public ByteString getNameBytes()
       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"`.
       
      string name = 1;
      Specified by:
      getNameBytes in interface OptionOrBuilder
      Returns:
      The bytes for name.
    • setName

      public Option.Builder setName(String value)
       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"`.
       
      string name = 1;
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public Option.Builder clearName()
       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"`.
       
      string name = 1;
      Returns:
      This builder for chaining.
    • setNameBytes

      public Option.Builder setNameBytes(ByteString value)
       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"`.
       
      string name = 1;
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • hasValue

      public boolean hasValue()
       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.
       
      .google.protobuf.Any value = 2;
      Specified by:
      hasValue in interface OptionOrBuilder
      Returns:
      Whether the value field is set.
    • getValue

      public Any 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.
       
      .google.protobuf.Any value = 2;
      Specified by:
      getValue in interface OptionOrBuilder
      Returns:
      The value.
    • setValue

      public Option.Builder setValue(Any value)
       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.
       
      .google.protobuf.Any value = 2;
    • setValue

      public Option.Builder setValue(Any.Builder builderForValue)
       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.
       
      .google.protobuf.Any value = 2;
    • mergeValue

      public Option.Builder mergeValue(Any value)
       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.
       
      .google.protobuf.Any value = 2;
    • clearValue

      public Option.Builder clearValue()
       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.
       
      .google.protobuf.Any value = 2;