Class Value
- All Implemented Interfaces:
Serializable
NULL or
non-NULL; regardless, values always have an associated type.
The Value API is optimized for construction, since this is the majority use-case when
using this class with the Cloud Spanner libraries. The factory method signatures and internal
representations are design to minimize memory usage and object creation while still maintaining
the immutability contract of this class. In particular, arrays of primitive types can be
constructed without requiring boxing into collections of wrapper types. The getters in this class
are intended primarily for test purposes, and so do not share the same performance
characteristics; in particular, getters for array types may be expensive.
Value instances are immutable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.cloud.TimestampPlaceholder value to be passed to a mutation to make Cloud Spanner store the commit timestamp in that column.static final StringConstant to specify a PG Numeric NaN value. -
Method Summary
Modifier and TypeMethodDescriptionstatic Valuebool(boolean v) Returns aBOOLvalue.static ValueReturns aBOOLvalue.static ValueboolArray(boolean[] v) Returns anARRAY<BOOL>value.static ValueboolArray(boolean[] v, int pos, int length) Returns anARRAY<BOOL>value that takes its elements from a region of an array.static ValueReturns anARRAY<BOOL>value.static Valuebytes(com.google.cloud.ByteArray v) e Returns aBYTESvalue.static ValuebytesArray(Iterable<com.google.cloud.ByteArray> v) Returns anARRAY<BYTES>value.static ValuebytesArrayFromBase64(Iterable<String> base64Strings) Returns anARRAY<BYTES>value.static ValuebytesFromBase64(String base64String) Returns aBYTESvalue.static Valuedate(com.google.cloud.Date v) Returns aDATEvalue.static ValueReturns anARRAY<DATE>value.static Valuefloat32(float v) Returns aFLOAT32value.static ValueReturns aFLOAT32value.static Valuefloat32Array(float[] v) Returns anARRAY<FLOAT32>value.static Valuefloat32Array(float[] v, int pos, int length) Returns anARRAY<FLOAT32>value that takes its elements from a region of an array.static ValueReturns anARRAY<FLOAT32>value.static Valuefloat64(double v) Returns aFLOAT64value.static ValueReturns aFLOAT64value.static Valuefloat64Array(double[] v) Returns anARRAY<FLOAT64>value.static Valuefloat64Array(double[] v, int pos, int length) Returns anARRAY<FLOAT64>value that takes its elements from a region of an array.static ValueReturns anARRAY<FLOAT64>value.Returns this value as a raw string representation.com.google.common.collect.ImmutableList<String>Returns this value as a list of raw string representations.abstract booleangetBool()Returns the value of aBOOL-typed instance.Returns the value of anARRAY<BOOL>-typed instance.abstract com.google.cloud.ByteArraygetBytes()Returns the value of aBYTES-typed instance.abstract List<com.google.cloud.ByteArray>Returns the value of anARRAY<BYTES>-typed instance.abstract com.google.cloud.DategetDate()Returns the value of aDATE-typed instance.abstract List<com.google.cloud.Date>Returns the value of anARRAY<DATE>-typed instance.abstract floatReturns the value of aFLOAT32-typed instance.Returns the value of anARRAY<FLOAT32>-typed instance.abstract doubleReturns the value of aFLOAT64-typed instance.Returns the value of anARRAY<FLOAT64>-typed instance.abstract longgetInt64()Returns the value of aINT64-typed instance.Returns the value of anARRAY<INT64>-typed instance.abstract IntervalReturns the value of aINTERVAL-typed instance.Returns the value of anARRAY<INTERVAL>-typed instance.getJson()Returns the value of aJSON-typed instance.Returns the value of anARRAY<JSON>-typed instance.abstract BigDecimalReturns the value of aNUMERIC-typed instance.abstract List<BigDecimal>Returns the value of anARRAY<NUMERIC>-typed instance.Returns the value of aJSONB-typed instance.Returns the value of anARRAY<JSONB>-typed instance.<T extends com.google.protobuf.ProtocolMessageEnum>
TgetProtoEnum(Function<Integer, com.google.protobuf.ProtocolMessageEnum> method) Returns the value of aENUM-typed instance.<T extends com.google.protobuf.ProtocolMessageEnum>
List<T>getProtoEnumArray(Function<Integer, com.google.protobuf.ProtocolMessageEnum> method) Returns the value of anARRAY<ENUM>-typed instance.<T extends com.google.protobuf.AbstractMessage>
TgetProtoMessage(T m) Returns the value of aPROTO-typed instance.<T extends com.google.protobuf.AbstractMessage>
List<T>getProtoMessageArray(T m) Returns the value of anARRAY<PROTO>-typed instance.abstract StringReturns the value of aSTRING-typed instance.Returns the value of anARRAY<STRING>-typed instance.abstract StructReturns the value of aSTRUCT-typed instance.Returns the value of anARRAY<STRUCT<...>>-typed instance.abstract com.google.cloud.TimestampReturns the value of aTIMESTAMP-typed instance.abstract List<com.google.cloud.Timestamp>Returns the value of anARRAY<TIMESTAMP>-typed instance.abstract TypegetType()Returns the type of this value.abstract UUIDgetUuid()Returns the value of aUUID-typed instance.Returns the value of anARRAY<UUID>-typed instance.static Valueint64(long v) Returns anINT64value.static ValueReturns anINT64value.static Valueint64Array(long[] v) Returns anARRAY<INT64>value.static Valueint64Array(long[] v, int pos, int length) Returns anARRAY<INT64>value that takes its elements from a region of an array.static Valueint64Array(Iterable<Long> v) Returns anARRAY<INT64>value.static ValueReturns aINTERVALvalue.static ValueReturns anARRAY<Interval>value.abstract booleanReturns true if this is a commit timestamp value.abstract booleanisNull()Returnstrueif this instance represents aNULLvalue.static ValueReturns aJSONvalue.static ValueReturns anARRAY<JSON>value.static ValueReturns aNUMERICvalue.static ValueReturns anARRAY<NUMERIC>value.static ValueReturns aPG JSONBvalue.static ValueReturns anARRAY<JSONB>value.static ValueReturns aPG NUMERICvalue.static ValueReturns anARRAY<PG_NUMERIC>value.static ValuepgOid(long v) Returns anPG_OIDvalue.static ValueReturns anPG_OIDvalue.static ValuepgOidArray(long[] v) Returns anARRAY<PG_OID>value.static ValuepgOidArray(long[] v, int pos, int length) Returns anARRAY<PG_OID>value that takes its elements from a region of an array.static ValuepgOidArray(Iterable<Long> v) Returns anARRAY<PG_OID>value.static ValueReturn aENUMvalue.static ValueprotoEnum(com.google.protobuf.ProtocolMessageEnum v) Return aENUMvalue for not null proto messages.static ValueReturn aENUMvalue.static ValueReturn aENUMvalue.static ValueprotoEnumArray(Iterable<com.google.protobuf.ProtocolMessageEnum> v, com.google.protobuf.Descriptors.EnumDescriptor descriptor) Returns anARRAY<ENUM>value.static ValueprotoEnumArray(Iterable<Long> v, String protoTypeFqn) Returns anARRAY<ENUM>value.static ValueprotoMessage(com.google.cloud.ByteArray v, com.google.protobuf.Descriptors.Descriptor descriptor) Return aPROTOvaluestatic ValueprotoMessage(com.google.cloud.ByteArray v, String protoTypeFqn) Return aPROTOvaluestatic ValueprotoMessage(com.google.protobuf.AbstractMessage v) Return aPROTOvalue for not null proto messages.static ValueprotoMessageArray(Iterable<com.google.cloud.ByteArray> v, String protoTypeFqn) Returns anARRAY<PROTO>value.static ValueprotoMessageArray(Iterable<com.google.protobuf.AbstractMessage> v, com.google.protobuf.Descriptors.Descriptor descriptor) Returns anARRAY<PROTO>value.static ValueReturns aSTRINGvalue.static ValueReturns anARRAY<STRING>value.static ValueReturns a non-NULL{#code STRUCT} value.static ValueReturns aSTRUCTvalue ofTypetype.static ValuestructArray(Type elementType, Iterable<Struct> v) Returns anARRAY<STRUCT<...>>value.static Valuetimestamp(com.google.cloud.Timestamp v) Returns aTIMESTAMPvalue.static ValuetimestampArray(Iterable<com.google.cloud.Timestamp> v) Returns anARRAY<TIMESTAMP>value.toString()static Valueuntyped(com.google.protobuf.Value value) Returns aValuethat wraps the given proto value.static Valuestatic ValueReturns anARRAY<UUID>value.
-
Field Details
-
COMMIT_TIMESTAMP
public static final com.google.cloud.Timestamp COMMIT_TIMESTAMPPlaceholder value to be passed to a mutation to make Cloud Spanner store the commit timestamp in that column. The commit timestamp is the timestamp corresponding to when Cloud Spanner commits the transaction containing the mutation.Note that this particular timestamp instance has no semantic meaning. In particular the value of seconds and nanoseconds in this timestamp are meaningless. This placeholder can only be used for columns that have set the option "(allow_commit_timestamp=true)" in the schema.
When reading the value stored in such a column, the value returned is an actual timestamp corresponding to the commit time of the transaction, which has no relation to this placeholder.
- See Also:
-
NAN
Constant to specify a PG Numeric NaN value.- See Also:
-
-
Method Details
-
untyped
Returns aValuethat wraps the given proto value. This can be used to construct a value without a specific type, and let the backend infer the type based on the statement where it is used.- Parameters:
value- the non-null proto value (aNullValueis allowed)
-
bool
Returns aBOOLvalue.- Parameters:
v- the value, which may be null
-
bool
Returns aBOOLvalue. -
int64
Returns anINT64value.- Parameters:
v- the value, which may be null
-
int64
Returns anINT64value. -
float32
Returns aFLOAT32value.- Parameters:
v- the value, which may be null
-
float32
Returns aFLOAT32value. -
float64
Returns aFLOAT64value.- Parameters:
v- the value, which may be null
-
float64
Returns aFLOAT64value. -
numeric
Returns aNUMERICvalue. The valid value range for the whole component of theBigDecimalis from -9,999,999,999,999,999,999,999,999 to +9,999,999,999,999,999,999,999,999 (both inclusive), i.e. the max length of the whole component is 29 digits. The max length of the fractional part is 9 digits. Trailing zeros in the fractional part are not considered and will be lost, as Cloud Spanner does not preserve the precision of a numeric value.If you set a numeric value of a record to for example 0.10, Cloud Spanner will return this value as 0.1 in subsequent queries. Use
BigDecimal.stripTrailingZeros()to compare inserted values with retrieved values if your application might insert numeric values with trailing zeros.- Parameters:
v- the value, which may be null
-
pgNumeric
Returns aPG NUMERICvalue. This value has flexible precision and scale which is specified in the Database DDL. This value also supportsNaNs, which can be specified withValue.pgNumeric(Value.NAN)or simply asValue.pgNumeric("NaN").Note that this flavour of numeric is different than Spanner numerics (
numeric(BigDecimal)). It should be used only for handling numerics in the PostgreSQL dialect.- Parameters:
v- the value, which may be null
-
string
Returns aSTRINGvalue.- Parameters:
v- the value, which may be null
-
json
Returns aJSONvalue.- Parameters:
v- the value, which may be null
-
interval
Returns aINTERVALvalue.- Parameters:
interval- the value, which may be null
-
pgJsonb
Returns aPG JSONBvalue.- Parameters:
v- the value, which may be null
-
pgOid
Returns anPG_OIDvalue.- Parameters:
v- the value, which may be null
-
pgOid
Returns anPG_OIDvalue. -
protoMessage
Return aPROTOvalue for not null proto messages.- Parameters:
v- Not null Proto message.
-
protoMessage
Return aPROTOvalue- Parameters:
v- Serialized Proto Array, which may be null.protoTypeFqn- Fully qualified name of proto representing the proto definition. Use static method from proto classMyProtoClass.getDescriptor().getFullName()
-
protoMessage
public static Value protoMessage(@Nullable com.google.cloud.ByteArray v, com.google.protobuf.Descriptors.Descriptor descriptor) Return aPROTOvalue- Parameters:
v- Serialized Proto Array, which may be null.descriptor- Proto Type Descriptor, use static method from proto classMyProtoClass.getDescriptor().
-
protoEnum
Return aENUMvalue for not null proto messages.- Parameters:
v- Proto Enum, which may be null.
-
protoEnum
Return aENUMvalue.- Parameters:
v- Enum non-primitive Integer constant.protoTypeFqn- Fully qualified name of proto representing the enum definition. Use static method from proto classMyProtoEnum.getDescriptor().getFullName()
-
protoEnum
public static Value protoEnum(@Nullable Long v, com.google.protobuf.Descriptors.EnumDescriptor enumDescriptor) Return aENUMvalue.- Parameters:
v- Enum non-primitive Integer constant.enumDescriptor- Enum Type Descriptor. Use static method from proto class* MyProtoEnum.getDescriptor().
-
protoEnum
Return aENUMvalue.- Parameters:
v- Enum integer primitive constant.protoTypeFqn- Fully qualified name of proto representing the enum definition. Use static method from proto classMyProtoEnum.getDescriptor().getFullName()
-
bytes
e Returns aBYTESvalue. Returns aBYTESvalue.- Parameters:
v- the value, which may be null
-
bytesFromBase64
Returns aBYTESvalue.- Parameters:
base64String- the value in Base64 encoding, which may be null. This value must be a valid base64 string.
-
timestamp
Returns aTIMESTAMPvalue. -
date
Returns aDATEvalue. The range [1678-01-01, 2262-01-01) is the legal interval for cloud spanner dates. A write to a date column is rejected if the value is outside of that interval. -
uuid
-
struct
Returns a non-NULL{#code STRUCT} value. -
struct
Returns aSTRUCTvalue ofTypetype.- Parameters:
type- the type of theSTRUCTvaluev- the structSTRUCTvalue. This may benullto produce a value for whichisNull()istrue. If non-null,StructReader.getType()must match type.
-
boolArray
Returns anARRAY<BOOL>value.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istrue
-
boolArray
Returns anARRAY<BOOL>value that takes its elements from a region of an array.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istruepos- the start position ofvto copy values from. Ignored ifvisnull.length- the number of values to copy fromv. Ignored ifvisnull.
-
boolArray
Returns anARRAY<BOOL>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
int64Array
Returns anARRAY<INT64>value.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istrue
-
int64Array
Returns anARRAY<INT64>value that takes its elements from a region of an array.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istruepos- the start position ofvto copy values from. Ignored ifvisnull.length- the number of values to copy fromv. Ignored ifvisnull.
-
int64Array
Returns anARRAY<INT64>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
float32Array
Returns anARRAY<FLOAT32>value.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istrue
-
float32Array
Returns anARRAY<FLOAT32>value that takes its elements from a region of an array.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istruepos- the start position ofvto copy values from. Ignored ifvisnull.length- the number of values to copy fromv. Ignored ifvisnull.
-
float32Array
Returns anARRAY<FLOAT32>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
float64Array
Returns anARRAY<FLOAT64>value.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istrue
-
float64Array
Returns anARRAY<FLOAT64>value that takes its elements from a region of an array.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istruepos- the start position ofvto copy values from. Ignored ifvisnull.length- the number of values to copy fromv. Ignored ifvisnull.
-
float64Array
Returns anARRAY<FLOAT64>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
numericArray
Returns anARRAY<NUMERIC>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
pgNumericArray
Returns anARRAY<PG_NUMERIC>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull. Individual elements may be"NaN"orNAN.
-
stringArray
Returns anARRAY<STRING>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
jsonArray
Returns anARRAY<JSON>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
pgJsonbArray
Returns anARRAY<JSONB>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
pgOidArray
Returns anARRAY<PG_OID>value.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istrue
-
pgOidArray
Returns anARRAY<PG_OID>value that takes its elements from a region of an array.- Parameters:
v- the source of element values, which may be null to produce a value for whichisNull()istruepos- the start position ofvto copy values from. Ignored ifvisnull.length- the number of values to copy fromv. Ignored ifvisnull.
-
pgOidArray
Returns anARRAY<PG_OID>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
protoMessageArray
public static Value protoMessageArray(@Nullable Iterable<com.google.protobuf.AbstractMessage> v, com.google.protobuf.Descriptors.Descriptor descriptor) Returns anARRAY<PROTO>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.descriptor- Proto Type Descriptor, use static method from proto classMyProtoClass.getDescriptor().
-
protoMessageArray
public static Value protoMessageArray(@Nullable Iterable<com.google.cloud.ByteArray> v, String protoTypeFqn) Returns anARRAY<PROTO>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.protoTypeFqn- Fully qualified name of proto representing the proto definition. Use static method from proto classMyProtoClass.getDescriptor().getFullName()
-
protoEnumArray
public static Value protoEnumArray(@Nullable Iterable<com.google.protobuf.ProtocolMessageEnum> v, com.google.protobuf.Descriptors.EnumDescriptor descriptor) Returns anARRAY<ENUM>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.descriptor- Proto Type Descriptor, use static method from proto classMyProtoClass.getDescriptor().
-
protoEnumArray
Returns anARRAY<ENUM>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.protoTypeFqn- Fully qualified name of proto representing the enum definition. Use static method from proto classMyProtoEnum.getDescriptor().getFullName()
-
bytesArray
Returns anARRAY<BYTES>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
bytesArrayFromBase64
Returns anARRAY<BYTES>value.- Parameters:
base64Strings- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull. Non-null values must be a valid Base64 string.
-
timestampArray
Returns anARRAY<TIMESTAMP>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
dateArray
Returns anARRAY<DATE>value. The range [1678-01-01, 2262-01-01) is the legal interval for cloud spanner dates. A write to a date column is rejected if the value is outside of that interval.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
uuidArray
Returns anARRAY<UUID>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
intervalArray
Returns anARRAY<Interval>value.- Parameters:
v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
structArray
Returns anARRAY<STRUCT<...>>value.- Parameters:
elementType-v- the source of element values. This may benullto produce a value for whichisNull()istrue. Individual elements may also benull.
-
getType
Returns the type of this value. This will return a type even ifisNull()is true. -
isNull
public abstract boolean isNull()Returnstrueif this instance represents aNULLvalue. -
getBool
public abstract boolean getBool()Returns the value of aBOOL-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getInt64
public abstract long getInt64()Returns the value of aINT64-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getFloat32
public abstract float getFloat32()Returns the value of aFLOAT32-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getFloat64
public abstract double getFloat64()Returns the value of aFLOAT64-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getNumeric
Returns the value of aNUMERIC-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getString
Returns the value of aSTRING-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getJson
Returns the value of aJSON-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getPgJsonb
Returns the value of aJSONB-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getProtoMessage
public <T extends com.google.protobuf.AbstractMessage> T getProtoMessage(T m) Returns the value of aPROTO-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getProtoEnum
public <T extends com.google.protobuf.ProtocolMessageEnum> T getProtoEnum(Function<Integer, com.google.protobuf.ProtocolMessageEnum> method) Returns the value of aENUM-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getBytes
public abstract com.google.cloud.ByteArray getBytes()Returns the value of aBYTES-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getTimestamp
public abstract com.google.cloud.Timestamp getTimestamp()Returns the value of aTIMESTAMP-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type orisCommitTimestamp().
-
isCommitTimestamp
public abstract boolean isCommitTimestamp()Returns true if this is a commit timestamp value. -
getDate
public abstract com.google.cloud.Date getDate()Returns the value of aDATE-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getUuid
Returns the value of aUUID-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getInterval
Returns the value of aINTERVAL-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getStruct
Returns the value of aSTRUCT-typed instance.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getBoolArray
Returns the value of anARRAY<BOOL>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getInt64Array
Returns the value of anARRAY<INT64>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getFloat32Array
Returns the value of anARRAY<FLOAT32>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getFloat64Array
Returns the value of anARRAY<FLOAT64>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getNumericArray
Returns the value of anARRAY<NUMERIC>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getStringArray
Returns the value of anARRAY<STRING>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getJsonArray
Returns the value of anARRAY<JSON>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getPgJsonbArray
Returns the value of anARRAY<JSONB>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getProtoMessageArray
Returns the value of anARRAY<PROTO>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getProtoEnumArray
public <T extends com.google.protobuf.ProtocolMessageEnum> List<T> getProtoEnumArray(Function<Integer, com.google.protobuf.ProtocolMessageEnum> method) Returns the value of anARRAY<ENUM>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getBytesArray
Returns the value of anARRAY<BYTES>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getTimestampArray
Returns the value of anARRAY<TIMESTAMP>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getDateArray
Returns the value of anARRAY<DATE>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getUuidArray
Returns the value of anARRAY<UUID>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getIntervalArray
Returns the value of anARRAY<INTERVAL>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
getStructArray
Returns the value of anARRAY<STRUCT<...>>-typed instance. While the returned list itself will never benull, elements of that list may be null.- Throws:
IllegalStateException- ifisNull()or the value is not of the expected type
-
toString
-
getAsString
Returns this value as a raw string representation. This is guaranteed to work for all values, regardless of the underlying data type, and is guaranteed not to be truncated.Returns the string "NULL" for null values.
-
getAsStringList
Returns this value as a list of raw string representations. This is guaranteed to work for all values, regardless of the underlying data type, and the strings are guaranteed not to be truncated. The method returns a singleton list for non-array values and a list containing as many elements as there are in the array for array values. This method can be used instead of thegetAsString()method if you need to quote the individual elements in an array.Returns the string "NULL" for null values.
-