public static final class Value.Builder extends GeneratedMessage.Builder<Value.Builder> implements ValueOrBuilder
google.protobuf.Value
`Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of that variants, absence of any variant indicates an error. The JSON representation for `Value` is JSON value.
| Modifier and Type | Method and Description |
|---|---|
Value |
build()
Constructs the message based on the state of the Builder.
|
Value |
buildPartial()
Like
MessageLite.Builder.build(), but does not throw an exception if the message
is missing required fields. |
Value.Builder |
clear()
Called by the initialization and clear code paths to allow subclasses to
reset any of their builtin fields back to the initial values.
|
Value.Builder |
clearBoolValue()
optional bool bool_value = 4; |
Value.Builder |
clearKind() |
Value.Builder |
clearListValue()
optional .google.protobuf.ListValue list_value = 6; |
Value.Builder |
clearNullValue()
optional .google.protobuf.NullValue null_value = 1; |
Value.Builder |
clearNumberValue()
optional double number_value = 2; |
Value.Builder |
clearStringValue()
optional string string_value = 3; |
Value.Builder |
clearStructValue()
optional .google.protobuf.Struct struct_value = 5; |
boolean |
getBoolValue()
optional bool bool_value = 4; |
Value |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
static Descriptors.Descriptor |
getDescriptor() |
Descriptors.Descriptor |
getDescriptorForType()
Get the message's type's descriptor.
|
Value.KindCase |
getKindCase() |
ListValue |
getListValue()
optional .google.protobuf.ListValue list_value = 6; |
ListValue.Builder |
getListValueBuilder()
optional .google.protobuf.ListValue list_value = 6; |
ListValueOrBuilder |
getListValueOrBuilder()
optional .google.protobuf.ListValue list_value = 6; |
NullValue |
getNullValue()
optional .google.protobuf.NullValue null_value = 1; |
int |
getNullValueValue()
optional .google.protobuf.NullValue null_value = 1; |
double |
getNumberValue()
optional double number_value = 2; |
java.lang.String |
getStringValue()
optional string string_value = 3; |
ByteString |
getStringValueBytes()
optional string string_value = 3; |
Struct |
getStructValue()
optional .google.protobuf.Struct struct_value = 5; |
Struct.Builder |
getStructValueBuilder()
optional .google.protobuf.Struct struct_value = 5; |
StructOrBuilder |
getStructValueOrBuilder()
optional .google.protobuf.Struct struct_value = 5; |
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded
messages are set, false otherwise.
|
Value.Builder |
mergeFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry)
Like
MessageLite.Builder.mergeFrom(CodedInputStream), but also
parses extensions. |
Value.Builder |
mergeFrom(Message other)
Merge
other into the message being built. |
Value.Builder |
mergeFrom(Value other) |
Value.Builder |
mergeListValue(ListValue value)
optional .google.protobuf.ListValue list_value = 6; |
Value.Builder |
mergeStructValue(Struct value)
optional .google.protobuf.Struct struct_value = 5; |
Value.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
Merge some unknown fields into the
UnknownFieldSet for this
message. |
Value.Builder |
setBoolValue(boolean value)
optional bool bool_value = 4; |
Value.Builder |
setListValue(ListValue.Builder builderForValue)
optional .google.protobuf.ListValue list_value = 6; |
Value.Builder |
setListValue(ListValue value)
optional .google.protobuf.ListValue list_value = 6; |
Value.Builder |
setNullValue(NullValue value)
optional .google.protobuf.NullValue null_value = 1; |
Value.Builder |
setNullValueValue(int value)
optional .google.protobuf.NullValue null_value = 1; |
Value.Builder |
setNumberValue(double value)
optional double number_value = 2; |
Value.Builder |
setStringValue(java.lang.String value)
optional string string_value = 3; |
Value.Builder |
setStringValueBytes(ByteString value)
optional string string_value = 3; |
Value.Builder |
setStructValue(Struct.Builder builderForValue)
optional .google.protobuf.Struct struct_value = 5; |
Value.Builder |
setStructValue(Struct value)
optional .google.protobuf.Struct struct_value = 5; |
Value.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
Set the
UnknownFieldSet for this message. |
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, newBuilderForField, setField, setRepeatedFieldfindInitializationErrors, getInitializationErrorString, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofpublic static final Descriptors.Descriptor getDescriptor()
public Value.Builder clear()
GeneratedMessage.Builderclear in interface Message.Builderclear in interface MessageLite.Builderclear in class GeneratedMessage.Builder<Value.Builder>public Descriptors.Descriptor getDescriptorForType()
Message.BuilderMessageOrBuilder.getDescriptorForType().getDescriptorForType in interface Message.BuildergetDescriptorForType in interface MessageOrBuildergetDescriptorForType in class GeneratedMessage.Builder<Value.Builder>public Value getDefaultInstanceForType()
MessageLiteOrBuildergetDefaultInstance() 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.getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilderpublic Value build()
MessageLite.Builderbuild in interface Message.Builderbuild in interface MessageLite.Builderpublic Value buildPartial()
MessageLite.BuilderMessageLite.Builder.build(), but does not throw an exception if the message
is missing required fields. Instead, a partial message is returned.
Subsequent changes to the Builder will not affect the returned message.buildPartial in interface Message.BuilderbuildPartial in interface MessageLite.Builderpublic Value.Builder mergeFrom(Message other)
Message.Builderother 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:other,
then other's value overwrites the value in this message.other,
it is merged into the corresponding sub-message of this message
using the same merging rules.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++.mergeFrom in interface Message.BuildermergeFrom in class AbstractMessage.Builder<Value.Builder>public Value.Builder mergeFrom(Value other)
public final boolean isInitialized()
MessageLiteOrBuilderisInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessage.Builder<Value.Builder>public Value.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
MessageLite.BuilderMessageLite.Builder.mergeFrom(CodedInputStream), but also
parses extensions. The extensions that you want to be able to parse
must be registered in extensionRegistry. Extensions not in
the registry will be treated as unknown fields.mergeFrom in interface Message.BuildermergeFrom in interface MessageLite.BuildermergeFrom in class AbstractMessage.Builder<Value.Builder>java.io.IOExceptionpublic Value.KindCase getKindCase()
getKindCase in interface ValueOrBuilderpublic Value.Builder clearKind()
public int getNullValueValue()
optional .google.protobuf.NullValue null_value = 1;
Represents a null value.
getNullValueValue in interface ValueOrBuilderpublic Value.Builder setNullValueValue(int value)
optional .google.protobuf.NullValue null_value = 1;
Represents a null value.
public NullValue getNullValue()
optional .google.protobuf.NullValue null_value = 1;
Represents a null value.
getNullValue in interface ValueOrBuilderpublic Value.Builder setNullValue(NullValue value)
optional .google.protobuf.NullValue null_value = 1;
Represents a null value.
public Value.Builder clearNullValue()
optional .google.protobuf.NullValue null_value = 1;
Represents a null value.
public double getNumberValue()
optional double number_value = 2;
Represents a double value.
getNumberValue in interface ValueOrBuilderpublic Value.Builder setNumberValue(double value)
optional double number_value = 2;
Represents a double value.
public Value.Builder clearNumberValue()
optional double number_value = 2;
Represents a double value.
public java.lang.String getStringValue()
optional string string_value = 3;
Represents a string value.
getStringValue in interface ValueOrBuilderpublic ByteString getStringValueBytes()
optional string string_value = 3;
Represents a string value.
getStringValueBytes in interface ValueOrBuilderpublic Value.Builder setStringValue(java.lang.String value)
optional string string_value = 3;
Represents a string value.
public Value.Builder clearStringValue()
optional string string_value = 3;
Represents a string value.
public Value.Builder setStringValueBytes(ByteString value)
optional string string_value = 3;
Represents a string value.
public boolean getBoolValue()
optional bool bool_value = 4;
Represents a boolean value.
getBoolValue in interface ValueOrBuilderpublic Value.Builder setBoolValue(boolean value)
optional bool bool_value = 4;
Represents a boolean value.
public Value.Builder clearBoolValue()
optional bool bool_value = 4;
Represents a boolean value.
public Struct getStructValue()
optional .google.protobuf.Struct struct_value = 5;
Represents a structured value.
getStructValue in interface ValueOrBuilderpublic Value.Builder setStructValue(Struct value)
optional .google.protobuf.Struct struct_value = 5;
Represents a structured value.
public Value.Builder setStructValue(Struct.Builder builderForValue)
optional .google.protobuf.Struct struct_value = 5;
Represents a structured value.
public Value.Builder mergeStructValue(Struct value)
optional .google.protobuf.Struct struct_value = 5;
Represents a structured value.
public Value.Builder clearStructValue()
optional .google.protobuf.Struct struct_value = 5;
Represents a structured value.
public Struct.Builder getStructValueBuilder()
optional .google.protobuf.Struct struct_value = 5;
Represents a structured value.
public StructOrBuilder getStructValueOrBuilder()
optional .google.protobuf.Struct struct_value = 5;
Represents a structured value.
getStructValueOrBuilder in interface ValueOrBuilderpublic ListValue getListValue()
optional .google.protobuf.ListValue list_value = 6;
Represents a repeated `Value`.
getListValue in interface ValueOrBuilderpublic Value.Builder setListValue(ListValue value)
optional .google.protobuf.ListValue list_value = 6;
Represents a repeated `Value`.
public Value.Builder setListValue(ListValue.Builder builderForValue)
optional .google.protobuf.ListValue list_value = 6;
Represents a repeated `Value`.
public Value.Builder mergeListValue(ListValue value)
optional .google.protobuf.ListValue list_value = 6;
Represents a repeated `Value`.
public Value.Builder clearListValue()
optional .google.protobuf.ListValue list_value = 6;
Represents a repeated `Value`.
public ListValue.Builder getListValueBuilder()
optional .google.protobuf.ListValue list_value = 6;
Represents a repeated `Value`.
public ListValueOrBuilder getListValueOrBuilder()
optional .google.protobuf.ListValue list_value = 6;
Represents a repeated `Value`.
getListValueOrBuilder in interface ValueOrBuilderpublic final Value.Builder setUnknownFields(UnknownFieldSet unknownFields)
Message.BuilderUnknownFieldSet for this message.setUnknownFields in interface Message.BuildersetUnknownFields in class GeneratedMessage.Builder<Value.Builder>public final Value.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Message.BuilderUnknownFieldSet for this
message.mergeUnknownFields in interface Message.BuildermergeUnknownFields in class GeneratedMessage.Builder<Value.Builder>