Class Option.Builder

    • Method Detail

      • maybeForceBuilderInitialization

        private void maybeForceBuilderInitialization()
      • getDefaultInstanceForType

        public Option getDefaultInstanceForType()
        Description copied from interface: MessageLiteOrBuilder
        Get an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from the getDefaultInstance() method of generated message classes in that this method is an abstract method of the MessageLite interface whereas getDefaultInstance() is a static method of a specific class. They return the same thing.
        Specified by:
        getDefaultInstanceForType in interface MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface MessageOrBuilder
      • buildPartial0

        private void buildPartial0​(Option result)
      • mergeFrom

        public Option.Builder mergeFrom​(Message other)
        Description copied from interface: Message.Builder
        Merge other into the message being built. other must have the exact same type as this (i.e. getDescriptorForType() == other.getDescriptorForType()).

        Merging occurs as follows. For each field:
        * For singular primitive fields, if the field is set in other, then other's value overwrites the value in this message.
        * For singular message fields, if the field is set in other, it is merged into the corresponding sub-message of this message using the same merging rules.
        * For repeated fields, the elements in other are concatenated with the elements in this message.
        * For oneof groups, if the other message has one of the fields set, the group of this message is cleared and replaced by the field of the other message, so that the oneof constraint is preserved.

        This is equivalent to the Message::MergeFrom method in C++.

        Specified by:
        mergeFrom in interface Message.Builder
        Overrides:
        mergeFrom in class AbstractMessage.Builder<Option.Builder>
      • getName

        public java.lang.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​(java.lang.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;
      • 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
      • getValueFieldBuilder

        private SingleFieldBuilder<Any,​Any.Builder,​AnyOrBuilder> getValueFieldBuilder()
         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;