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.
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; |
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; |
protected GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable()
Get the FieldAccessorTable for this type.
|
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(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, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField
findInitializationErrors, getInitializationErrorString, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
GeneratedMessage.Builder
internalGetFieldAccessorTable
in class GeneratedMessage.Builder<Value.Builder>
public Value.Builder clear()
GeneratedMessage.Builder
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessage.Builder<Value.Builder>
public Descriptors.Descriptor getDescriptorForType()
Message.Builder
MessageOrBuilder.getDescriptorForType()
.getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessage.Builder<Value.Builder>
public Value getDefaultInstanceForType()
MessageLiteOrBuilder
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.getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public Value build()
MessageLite.Builder
build
in interface Message.Builder
build
in interface MessageLite.Builder
public Value buildPartial()
MessageLite.Builder
MessageLite.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.Builder
buildPartial
in interface MessageLite.Builder
public Value.Builder mergeFrom(Message other)
Message.Builder
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: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.
This is equivalent to the Message::MergeFrom
method in C++.mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<Value.Builder>
public Value.Builder mergeFrom(Value other)
public final boolean isInitialized()
MessageLiteOrBuilder
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessage.Builder<Value.Builder>
public Value.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
MessageLite.Builder
MessageLite.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.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<Value.Builder>
IOException
public Value.KindCase getKindCase()
public Value.Builder clearKind()
public int getNullValueValue()
optional .google.protobuf.NullValue null_value = 1;
Represents a null value.
getNullValueValue
in interface ValueOrBuilder
public 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 ValueOrBuilder
public 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 ValueOrBuilder
public 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 String getStringValue()
optional string string_value = 3;
Represents a string value.
getStringValue
in interface ValueOrBuilder
public ByteString getStringValueBytes()
optional string string_value = 3;
Represents a string value.
getStringValueBytes
in interface ValueOrBuilder
public Value.Builder setStringValue(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 ValueOrBuilder
public 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 ValueOrBuilder
public 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 ValueOrBuilder
public ListValue getListValue()
optional .google.protobuf.ListValue list_value = 6;
Represents a repeated `Value`.
getListValue
in interface ValueOrBuilder
public 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 ValueOrBuilder
public final Value.Builder setUnknownFields(UnknownFieldSet unknownFields)
Message.Builder
UnknownFieldSet
for this message.setUnknownFields
in interface Message.Builder
setUnknownFields
in class GeneratedMessage.Builder<Value.Builder>
public final Value.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Message.Builder
UnknownFieldSet
for this
message.mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessage.Builder<Value.Builder>
Copyright © 2008–2015 Google. All rights reserved.