Class Option.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderType>
com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
com.google.protobuf.Option.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, OptionOrBuilder, Cloneable
Enclosing class:
Option

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

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • clear

      public Option.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • getDefaultInstanceForType

      public Option getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Option build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Option buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public Option.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • setField

      public Option.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • clearField

      public Option.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • clearOneof

      public Option.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • setRepeatedField

      public Option.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • addRepeatedField

      public Option.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • mergeFrom

      public Option.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Option.Builder>
    • mergeFrom

      public Option.Builder mergeFrom(Option other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • mergeFrom

      public Option.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Option.Builder>
      Throws:
      IOException
    • 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 com.google.protobuf.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(com.google.protobuf.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;
    • getValueBuilder

      public Any.Builder getValueBuilder()
       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;
    • getValueOrBuilder

      public AnyOrBuilder getValueOrBuilder()
       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:
      getValueOrBuilder in interface OptionOrBuilder
    • setUnknownFields

      public final Option.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>
    • mergeUnknownFields

      public final Option.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Option.Builder>