Package com.google.protobuf
Class Value
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite<MessageType,BuilderType>
-
- com.google.protobuf.GeneratedMessageLite<Value,Value.Builder>
-
- com.google.protobuf.Value
-
- All Implemented Interfaces:
MessageLite
,MessageLiteOrBuilder
,ValueOrBuilder
public final class Value extends GeneratedMessageLite<Value,Value.Builder> implements ValueOrBuilder
`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 these variants. Absence of any variant indicates an error. The JSON representation for `Value` is JSON value.
Protobuf typegoogle.protobuf.Value
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Value.Builder
`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.static class
Value.KindCase
-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite
GeneratedMessageLite.DefaultInstanceBasedParser<T extends GeneratedMessageLite<T,?>>, GeneratedMessageLite.ExtendableBuilder<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageLite.ExtendableMessage<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageLite.ExtensionDescriptor, GeneratedMessageLite.GeneratedExtension<ContainingType extends MessageLite,Type>, GeneratedMessageLite.MethodToInvoke, GeneratedMessageLite.SerializedForm
-
Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
AbstractMessageLite.InternalOneOfEnum
-
-
Field Summary
Fields Modifier and Type Field Description static int
BOOL_VALUE_FIELD_NUMBER
private static Value
DEFAULT_INSTANCE
private java.lang.Object
kind_
private int
kindCase_
static int
LIST_VALUE_FIELD_NUMBER
static int
NULL_VALUE_FIELD_NUMBER
static int
NUMBER_VALUE_FIELD_NUMBER
private static Parser<Value>
PARSER
static int
STRING_VALUE_FIELD_NUMBER
static int
STRUCT_VALUE_FIELD_NUMBER
-
Fields inherited from class com.google.protobuf.GeneratedMessageLite
UNINITIALIZED_HASH_CODE, UNINITIALIZED_SERIALIZED_SIZE, unknownFields
-
Fields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Value()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
clearBoolValue()
Represents a boolean value.private void
clearKind()
private void
clearListValue()
Represents a repeated `Value`.private void
clearNullValue()
Represents a null value.private void
clearNumberValue()
Represents a double value.private void
clearStringValue()
Represents a string value.private void
clearStructValue()
Represents a structured value.protected java.lang.Object
dynamicMethod(GeneratedMessageLite.MethodToInvoke method, java.lang.Object arg0, java.lang.Object arg1)
A method that implements different types of operations described inGeneratedMessageLite.MethodToInvoke
.boolean
getBoolValue()
Represents a boolean value.static Value
getDefaultInstance()
Value.KindCase
getKindCase()
ListValue
getListValue()
Represents a repeated `Value`.NullValue
getNullValue()
Represents a null value.int
getNullValueValue()
Represents a null value.double
getNumberValue()
Represents a double value.java.lang.String
getStringValue()
Represents a string value.ByteString
getStringValueBytes()
Represents a string value.Struct
getStructValue()
Represents a structured value.boolean
hasBoolValue()
Represents a boolean value.boolean
hasListValue()
Represents a repeated `Value`.boolean
hasNullValue()
Represents a null value.boolean
hasNumberValue()
Represents a double value.boolean
hasStringValue()
Represents a string value.boolean
hasStructValue()
Represents a structured value.private void
mergeListValue(ListValue value)
Represents a repeated `Value`.private void
mergeStructValue(Struct value)
Represents a structured value.static Value.Builder
newBuilder()
static Value.Builder
newBuilder(Value prototype)
static Value
parseDelimitedFrom(java.io.InputStream input)
static Value
parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry)
static Value
parseFrom(byte[] data)
static Value
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
static Value
parseFrom(ByteString data)
static Value
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
static Value
parseFrom(CodedInputStream input)
static Value
parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
static Value
parseFrom(java.io.InputStream input)
static Value
parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry)
static Value
parseFrom(java.nio.ByteBuffer data)
static Value
parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry)
static Parser<Value>
parser()
private void
setBoolValue(boolean value)
Represents a boolean value.private void
setListValue(ListValue value)
Represents a repeated `Value`.private void
setNullValue(NullValue value)
Represents a null value.private void
setNullValueValue(int value)
Represents a null value.private void
setNumberValue(double value)
Represents a double value.private void
setStringValue(java.lang.String value)
Represents a string value.private void
setStringValueBytes(ByteString value)
Represents a string value.private void
setStructValue(Struct value)
Represents a structured value.-
Methods inherited from class com.google.protobuf.GeneratedMessageLite
buildMessageInfo, clearMemoizedHashCode, clearMemoizedSerializedSize, computeHashCode, createBuilder, createBuilder, dynamicMethod, dynamicMethod, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstance, getDefaultInstanceForType, getMemoizedHashCode, getMemoizedSerializedSize, getMethodOrDie, getParserForType, getSerializedSize, getSerializedSize, hashCode, hashCodeIsNotMemoized, invokeOrDie, isInitialized, isInitialized, isMutable, makeImmutable, markImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newMutableInstance, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, setMemoizedHashCode, setMemoizedSerializedSize, toBuilder, toString, writeTo
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, newUninitializedMessageException, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
-
-
-
Field Detail
-
kindCase_
private int kindCase_
-
kind_
private java.lang.Object kind_
-
NULL_VALUE_FIELD_NUMBER
public static final int NULL_VALUE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
NUMBER_VALUE_FIELD_NUMBER
public static final int NUMBER_VALUE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
STRING_VALUE_FIELD_NUMBER
public static final int STRING_VALUE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
BOOL_VALUE_FIELD_NUMBER
public static final int BOOL_VALUE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
STRUCT_VALUE_FIELD_NUMBER
public static final int STRUCT_VALUE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
LIST_VALUE_FIELD_NUMBER
public static final int LIST_VALUE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
DEFAULT_INSTANCE
private static final Value DEFAULT_INSTANCE
-
-
Method Detail
-
getKindCase
public Value.KindCase getKindCase()
- Specified by:
getKindCase
in interfaceValueOrBuilder
-
clearKind
private void clearKind()
-
hasNullValue
public boolean hasNullValue()
Represents a null value.
.google.protobuf.NullValue null_value = 1;
- Specified by:
hasNullValue
in interfaceValueOrBuilder
- Returns:
- Whether the nullValue field is set.
-
getNullValueValue
public int getNullValueValue()
Represents a null value.
.google.protobuf.NullValue null_value = 1;
- Specified by:
getNullValueValue
in interfaceValueOrBuilder
- Returns:
- The enum numeric value on the wire for nullValue.
-
getNullValue
public NullValue getNullValue()
Represents a null value.
.google.protobuf.NullValue null_value = 1;
- Specified by:
getNullValue
in interfaceValueOrBuilder
- Returns:
- The nullValue.
-
setNullValueValue
private void setNullValueValue(int value)
Represents a null value.
.google.protobuf.NullValue null_value = 1;
- Parameters:
value
- The enum numeric value on the wire for nullValue to set.
-
setNullValue
private void setNullValue(NullValue value)
Represents a null value.
.google.protobuf.NullValue null_value = 1;
- Parameters:
value
- The nullValue to set.
-
clearNullValue
private void clearNullValue()
Represents a null value.
.google.protobuf.NullValue null_value = 1;
-
hasNumberValue
public boolean hasNumberValue()
Represents a double value.
double number_value = 2;
- Specified by:
hasNumberValue
in interfaceValueOrBuilder
- Returns:
- Whether the numberValue field is set.
-
getNumberValue
public double getNumberValue()
Represents a double value.
double number_value = 2;
- Specified by:
getNumberValue
in interfaceValueOrBuilder
- Returns:
- The numberValue.
-
setNumberValue
private void setNumberValue(double value)
Represents a double value.
double number_value = 2;
- Parameters:
value
- The numberValue to set.
-
clearNumberValue
private void clearNumberValue()
Represents a double value.
double number_value = 2;
-
hasStringValue
public boolean hasStringValue()
Represents a string value.
string string_value = 3;
- Specified by:
hasStringValue
in interfaceValueOrBuilder
- Returns:
- Whether the stringValue field is set.
-
getStringValue
public java.lang.String getStringValue()
Represents a string value.
string string_value = 3;
- Specified by:
getStringValue
in interfaceValueOrBuilder
- Returns:
- The stringValue.
-
getStringValueBytes
public ByteString getStringValueBytes()
Represents a string value.
string string_value = 3;
- Specified by:
getStringValueBytes
in interfaceValueOrBuilder
- Returns:
- The bytes for stringValue.
-
setStringValue
private void setStringValue(java.lang.String value)
Represents a string value.
string string_value = 3;
- Parameters:
value
- The stringValue to set.
-
clearStringValue
private void clearStringValue()
Represents a string value.
string string_value = 3;
-
setStringValueBytes
private void setStringValueBytes(ByteString value)
Represents a string value.
string string_value = 3;
- Parameters:
value
- The bytes for stringValue to set.
-
hasBoolValue
public boolean hasBoolValue()
Represents a boolean value.
bool bool_value = 4;
- Specified by:
hasBoolValue
in interfaceValueOrBuilder
- Returns:
- Whether the boolValue field is set.
-
getBoolValue
public boolean getBoolValue()
Represents a boolean value.
bool bool_value = 4;
- Specified by:
getBoolValue
in interfaceValueOrBuilder
- Returns:
- The boolValue.
-
setBoolValue
private void setBoolValue(boolean value)
Represents a boolean value.
bool bool_value = 4;
- Parameters:
value
- The boolValue to set.
-
clearBoolValue
private void clearBoolValue()
Represents a boolean value.
bool bool_value = 4;
-
hasStructValue
public boolean hasStructValue()
Represents a structured value.
.google.protobuf.Struct struct_value = 5;
- Specified by:
hasStructValue
in interfaceValueOrBuilder
- Returns:
- Whether the structValue field is set.
-
getStructValue
public Struct getStructValue()
Represents a structured value.
.google.protobuf.Struct struct_value = 5;
- Specified by:
getStructValue
in interfaceValueOrBuilder
- Returns:
- The structValue.
-
setStructValue
private void setStructValue(Struct value)
Represents a structured value.
.google.protobuf.Struct struct_value = 5;
-
mergeStructValue
private void mergeStructValue(Struct value)
Represents a structured value.
.google.protobuf.Struct struct_value = 5;
-
clearStructValue
private void clearStructValue()
Represents a structured value.
.google.protobuf.Struct struct_value = 5;
-
hasListValue
public boolean hasListValue()
Represents a repeated `Value`.
.google.protobuf.ListValue list_value = 6;
- Specified by:
hasListValue
in interfaceValueOrBuilder
- Returns:
- Whether the listValue field is set.
-
getListValue
public ListValue getListValue()
Represents a repeated `Value`.
.google.protobuf.ListValue list_value = 6;
- Specified by:
getListValue
in interfaceValueOrBuilder
- Returns:
- The listValue.
-
setListValue
private void setListValue(ListValue value)
Represents a repeated `Value`.
.google.protobuf.ListValue list_value = 6;
-
mergeListValue
private void mergeListValue(ListValue value)
Represents a repeated `Value`.
.google.protobuf.ListValue list_value = 6;
-
clearListValue
private void clearListValue()
Represents a repeated `Value`.
.google.protobuf.ListValue list_value = 6;
-
parseFrom
public static Value parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Value parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Value parseFrom(ByteString data) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Value parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Value parseFrom(byte[] data) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Value parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
parseFrom
public static Value parseFrom(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static Value parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static Value parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static Value parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static Value parseFrom(CodedInputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static Value parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
newBuilder
public static Value.Builder newBuilder()
-
newBuilder
public static Value.Builder newBuilder(Value prototype)
-
dynamicMethod
protected final java.lang.Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, java.lang.Object arg0, java.lang.Object arg1)
Description copied from class:GeneratedMessageLite
A method that implements different types of operations described inGeneratedMessageLite.MethodToInvoke
. These different kinds of operations are required to implement message-level operations for builders in the runtime. This method bundles those operations to reduce the generated methods count.NEW_INSTANCE
returns a new instance of the protocol buffer that has not yet been made immutable. SeeMAKE_IMMUTABLE
.IS_INITIALIZED
returnsnull
for false and the default instance for true. It doesn't use or modify any memoized value.GET_MEMOIZED_IS_INITIALIZED
returns the memoizedisInitialized
byte value.SET_MEMOIZED_IS_INITIALIZED
sets the memoizedisInitialized
byte value to 1 if the first parameter is not null, or to 0 if the first parameter is null.NEW_BUILDER
returns aBuilderType
instance.
For use by generated code only.
- Specified by:
dynamicMethod
in classGeneratedMessageLite<Value,Value.Builder>
-
getDefaultInstance
public static Value getDefaultInstance()
-
-