Package com.google.cloud.spanner
Class ValueBinder<R>
java.lang.Object
com.google.cloud.spanner.ValueBinder<R>
- Type Parameters:
R
- The context which is used to bind theValue
.
An interface for binding a
Value
in some context. Users of the Cloud Spanner client
library never create a ValueBinder
directly; instead this interface is returned from
other parts of the library involved in Value
construction. For example, Mutation.WriteBuilder.set(String)
returns a binder to bind a column value, and
Statement#bind(String)
returns a binder to bind a parameter to a value.
ValueBinder
subclasses typically carry state and are therefore not thread-safe,
although the core implementation itself is thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionto
(boolean value) Binds toValue.bool(value)
to
(double value) Binds toValue.float64(value)
to
(float value) Binds toValue.float32(value)
to
(long value) Binds toValue.int64(value)
Binds toValue.protoEnum(value, protoType)
to
(com.google.cloud.ByteArray value) Binds toValue.bytes(value)
.to
(com.google.cloud.ByteArray v, com.google.protobuf.Descriptors.Descriptor descriptor) Binds toValue.protoMessage(value, descriptor)
Binds toValue.protoMessage(value, protoType)
to
(com.google.cloud.Date value) Binds toValue.date(value)
Binds a non-NULL
struct value toValue.struct(value)
Binds a nullableStruct
reference with givenType
toValue.struct(type,value
Binds aValue
to
(com.google.cloud.Timestamp value) Binds toValue.timestamp(value)
to
(com.google.protobuf.AbstractMessage m) Binds toValue.protoMessage(value)
to
(com.google.protobuf.ProtocolMessageEnum value) Binds toValue.protoEnum(value)
Binds toValue.bool(value)
Binds toValue.float64(value)
Binds toValue.float32(value)
Binds toValue.int64(value)
Binds toValue.protoEnum(value, enumDescriptor)
Binds toValue.protoEnum(value, protoType)
Binds toValue.string(value)
to
(BigDecimal value) Binds toValue.numeric(value)
toBoolArray
(boolean[] values) Binds toValue.boolArray(values)
toBoolArray
(boolean[] values, int pos, int length) Binds toValue.boolArray(values, int, pos)
toBoolArray
(Iterable<Boolean> values) Binds toValue.boolArray(values)
toBytesArray
(Iterable<com.google.cloud.ByteArray> values) Binds toValue.bytesArray(values)
toBytesArrayFromBase64
(Iterable<String> valuesAsBase64Strings) Binds toValue.bytesArray(values)
.toDateArray
(Iterable<com.google.cloud.Date> values) Binds toValue.dateArray(values)
toFloat32Array
(float[] values) Binds toValue.float32Array(values)
toFloat32Array
(float[] values, int pos, int length) Binds toValue.float32Array(values, pos, length)
toFloat32Array
(Iterable<Float> values) Binds toValue.float32Array(values)
toFloat64Array
(double[] values) Binds toValue.float64Array(values)
toFloat64Array
(double[] values, int pos, int length) Binds toValue.float64Array(values, pos, length)
toFloat64Array
(Iterable<Double> values) Binds toValue.float64Array(values)
toInt64Array
(long[] values) Binds toValue.int64Array(values)
toInt64Array
(long[] values, int pos, int length) Binds toValue.int64Array(values, pos, length)
toInt64Array
(Iterable<Long> values) Binds toValue.int64Array(values)
toJsonArray
(Iterable<String> values) Binds toValue.jsonArray(values)
toNumericArray
(Iterable<BigDecimal> values) Binds toValue.numericArray(values)
toPgJsonbArray
(Iterable<String> values) Binds toValue.jsonbArray(values)
toPgNumericArray
(Iterable<String> values) Binds toValue.pgNumericArray(values)
toProtoEnumArray
(Iterable<com.google.protobuf.ProtocolMessageEnum> values, com.google.protobuf.Descriptors.EnumDescriptor descriptor) Binds toValue.protoEnumArray(values, descriptor)
toProtoEnumArray
(Iterable<Long> values, String protoTypeFq) Binds toValue.protoEnumArray(values, protoTypeFq)
toProtoMessageArray
(Iterable<com.google.cloud.ByteArray> values, String protoTypeFq) Binds toValue.protoMessageArray(values, protoTypeFq)
toProtoMessageArray
(Iterable<com.google.protobuf.AbstractMessage> values, com.google.protobuf.Descriptors.Descriptor descriptor) Binds toValue.protoMessageArray(values, descriptor)
toStringArray
(Iterable<String> values) Binds toValue.stringArray(values)
toStructArray
(Type elementType, Iterable<Struct> values) Binds toValue.structArray(fieldTypes, values)
toTimestampArray
(Iterable<com.google.cloud.Timestamp> values) Binds toValue.timestampArray(values)
-
Method Details
-
to
Binds aValue
-
to
Binds toValue.bool(value)
-
to
Binds toValue.bool(value)
-
to
Binds toValue.int64(value)
-
to
Binds toValue.int64(value)
-
to
Binds toValue.float32(value)
-
to
Binds toValue.float32(value)
-
to
Binds toValue.float64(value)
-
to
Binds toValue.float64(value)
-
to
Binds toValue.numeric(value)
-
to
Binds toValue.string(value)
-
to
Binds toValue.protoMessage(value)
-
to
Binds toValue.protoMessage(value, protoType)
-
to
public R to(@Nullable com.google.cloud.ByteArray v, com.google.protobuf.Descriptors.Descriptor descriptor) Binds toValue.protoMessage(value, descriptor)
-
to
Binds toValue.protoEnum(value)
-
to
Binds toValue.protoEnum(value, protoType)
-
to
Binds toValue.protoEnum(value, enumDescriptor)
-
to
Binds toValue.protoEnum(value, protoType)
-
to
Binds toValue.bytes(value)
. Useto(Value)
in combination withValue.bytesFromBase64(String)
if you already have the value that you want to bind in base64 format. This prevents unnecessary decoding and encoding of base64 strings. -
to
Binds toValue.timestamp(value)
-
to
Binds toValue.date(value)
-
to
Binds a non-NULL
struct value toValue.struct(value)
-
to
Binds a nullableStruct
reference with givenType
toValue.struct(type,value
-
toBoolArray
Binds toValue.boolArray(values)
-
toBoolArray
Binds toValue.boolArray(values, int, pos)
-
toBoolArray
Binds toValue.boolArray(values)
-
toInt64Array
Binds toValue.int64Array(values)
-
toInt64Array
Binds toValue.int64Array(values, pos, length)
-
toInt64Array
Binds toValue.int64Array(values)
-
toFloat32Array
Binds toValue.float32Array(values)
-
toFloat32Array
Binds toValue.float32Array(values, pos, length)
-
toFloat32Array
Binds toValue.float32Array(values)
-
toFloat64Array
Binds toValue.float64Array(values)
-
toFloat64Array
Binds toValue.float64Array(values, pos, length)
-
toFloat64Array
Binds toValue.float64Array(values)
-
toNumericArray
Binds toValue.numericArray(values)
-
toPgNumericArray
Binds toValue.pgNumericArray(values)
-
toStringArray
Binds toValue.stringArray(values)
-
toJsonArray
Binds toValue.jsonArray(values)
-
toPgJsonbArray
Binds toValue.jsonbArray(values)
-
toBytesArray
Binds toValue.bytesArray(values)
-
toBytesArrayFromBase64
Binds toValue.bytesArray(values)
. The given strings must be valid base64 encoded strings. Use this method instead oftoBytesArray(Iterable)
if you already have the values in base64 format to prevent unnecessary decoding and encoding to/from base64. -
toTimestampArray
Binds toValue.timestampArray(values)
-
toProtoMessageArray
public R toProtoMessageArray(@Nullable Iterable<com.google.protobuf.AbstractMessage> values, com.google.protobuf.Descriptors.Descriptor descriptor) Binds toValue.protoMessageArray(values, descriptor)
-
toProtoMessageArray
public R toProtoMessageArray(@Nullable Iterable<com.google.cloud.ByteArray> values, String protoTypeFq) Binds toValue.protoMessageArray(values, protoTypeFq)
-
toProtoEnumArray
public R toProtoEnumArray(@Nullable Iterable<com.google.protobuf.ProtocolMessageEnum> values, com.google.protobuf.Descriptors.EnumDescriptor descriptor) Binds toValue.protoEnumArray(values, descriptor)
-
toProtoEnumArray
Binds toValue.protoEnumArray(values, protoTypeFq)
-
toDateArray
Binds toValue.dateArray(values)
-
toStructArray
Binds toValue.structArray(fieldTypes, values)
-