Package com.google.protobuf
Class Option.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<Option,Option.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<Option,Option.Builder>
com.google.protobuf.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
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite.Builder
AbstractMessageLite.Builder.LimitedInputStream
-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe option's name.The option's value packed in an Any message.getName()
The option's name.The option's name.getValue()
The option's value packed in an Any message.boolean
hasValue()
The option's value packed in an Any message.mergeValue
(Any value) The option's value packed in an Any message.The option's name.setNameBytes
(ByteString value) The option's name.The option's value packed in an Any message.setValue
(Any.Builder builderForValue) The option's value packed in an Any message.Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
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 interfaceOptionOrBuilder
- Returns:
- The name.
-
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 interfaceOptionOrBuilder
- Returns:
- The bytes for name.
-
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"`.
string name = 1;
- Parameters:
value
- The name to set.- Returns:
- This builder for chaining.
-
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
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 interfaceOptionOrBuilder
- Returns:
- Whether the value field is set.
-
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 interfaceOptionOrBuilder
- Returns:
- The value.
-
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.
.google.protobuf.Any value = 2;
-
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.
.google.protobuf.Any value = 2;
-
mergeValue
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
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;
-