public abstract class ValueBinder<R>
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.
Type Parameter |
Name |
Description |
R |
|
Methods
to(boolean value)
public R to(boolean value)
Binds to Value.bool(value)
Parameter |
Name |
Description |
value |
boolean
|
Returns |
Type |
Description |
R |
|
to(ByteArray value)
public R to(ByteArray value)
Binds to Value.bytes(value)
. Use #to(Value) in combination with Value#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.
Parameter |
Name |
Description |
value |
com.google.cloud.ByteArray
|
Returns |
Type |
Description |
R |
|
to(ByteArray v, Descriptors.Descriptor descriptor)
public R to(ByteArray v, Descriptors.Descriptor descriptor)
Binds to Value.protoMessage(value, descriptor)
Parameters |
Name |
Description |
v |
com.google.cloud.ByteArray
|
descriptor |
Descriptor
|
Returns |
Type |
Description |
R |
|
to(ByteArray v, String protoTypFqn)
public R to(ByteArray v, String protoTypFqn)
Binds to Value.protoMessage(value, protoType)
Parameters |
Name |
Description |
v |
com.google.cloud.ByteArray
|
protoTypFqn |
String
|
Returns |
Type |
Description |
R |
|
to(Date value)
Binds to Value.date(value)
Parameter |
Name |
Description |
value |
com.google.cloud.Date
|
Returns |
Type |
Description |
R |
|
to(Timestamp value)
public R to(Timestamp value)
Binds to Value.timestamp(value)
Parameter |
Name |
Description |
value |
com.google.cloud.Timestamp
|
Returns |
Type |
Description |
R |
|
to(Struct value)
public R to(Struct value)
Binds a non-NULL
struct value to Value.struct(value)
Parameter |
Name |
Description |
value |
Struct
|
Returns |
Type |
Description |
R |
|
to(Type type, Struct value)
public R to(Type type, Struct value)
Binds a nullable Struct
reference with given Type
to
Value.struct(type,value
Parameters |
Name |
Description |
type |
Type
|
value |
Struct
|
Returns |
Type |
Description |
R |
|
to(Value value)
Parameter |
Name |
Description |
value |
Value
|
Returns |
Type |
Description |
R |
|
to(AbstractMessage m)
public R to(AbstractMessage m)
Binds to Value.protoMessage(value)
Returns |
Type |
Description |
R |
|
to(ProtocolMessageEnum value)
public R to(ProtocolMessageEnum value)
Binds to Value.protoEnum(value)
Returns |
Type |
Description |
R |
|
to(double value)
public R to(double value)
Binds to Value.float64(value)
Parameter |
Name |
Description |
value |
double
|
Returns |
Type |
Description |
R |
|
to(float value)
Binds to Value.float32(value)
Parameter |
Name |
Description |
value |
float
|
Returns |
Type |
Description |
R |
|
to(Boolean value)
public R to(Boolean value)
Binds to Value.bool(value)
Parameter |
Name |
Description |
value |
Boolean
|
Returns |
Type |
Description |
R |
|
to(Double value)
public R to(Double value)
Binds to Value.float64(value)
Parameter |
Name |
Description |
value |
Double
|
Returns |
Type |
Description |
R |
|
to(Float value)
Binds to Value.float32(value)
Parameter |
Name |
Description |
value |
Float
|
Returns |
Type |
Description |
R |
|
to(Long value)
Binds to Value.int64(value)
Parameter |
Name |
Description |
value |
Long
|
Returns |
Type |
Description |
R |
|
to(Long v, Descriptors.EnumDescriptor enumDescriptor)
public R to(Long v, Descriptors.EnumDescriptor enumDescriptor)
Binds to Value.protoEnum(value, enumDescriptor)
Returns |
Type |
Description |
R |
|
to(Long v, String protoTypFqn)
public R to(Long v, String protoTypFqn)
Binds to Value.protoEnum(value, protoType)
Parameters |
Name |
Description |
v |
Long
|
protoTypFqn |
String
|
Returns |
Type |
Description |
R |
|
to(String value)
public R to(String value)
Binds to Value.string(value)
Parameter |
Name |
Description |
value |
String
|
Returns |
Type |
Description |
R |
|
to(BigDecimal value)
public R to(BigDecimal value)
Binds to Value.numeric(value)
Returns |
Type |
Description |
R |
|
to(long value)
Binds to Value.int64(value)
Parameter |
Name |
Description |
value |
long
|
Returns |
Type |
Description |
R |
|
to(long v, String protoTypFqn)
public R to(long v, String protoTypFqn)
Binds to Value.protoEnum(value, protoType)
Parameters |
Name |
Description |
v |
long
|
protoTypFqn |
String
|
Returns |
Type |
Description |
R |
|
toBoolArray(boolean[] values)
public R toBoolArray(boolean[] values)
Binds to Value.boolArray(values)
Parameter |
Name |
Description |
values |
boolean[]
|
Returns |
Type |
Description |
R |
|
toBoolArray(boolean[] values, int pos, int length)
public R toBoolArray(boolean[] values, int pos, int length)
Binds to Value.boolArray(values, int, pos)
Returns |
Type |
Description |
R |
|
toBoolArray(Iterable<Boolean> values)
public R toBoolArray(Iterable<Boolean> values)
Binds to Value.boolArray(values)
Returns |
Type |
Description |
R |
|
toBytesArray(Iterable<ByteArray> values)
public R toBytesArray(Iterable<ByteArray> values)
Binds to Value.bytesArray(values)
Parameter |
Name |
Description |
values |
Iterable<com.google.cloud.ByteArray>
|
Returns |
Type |
Description |
R |
|
toBytesArrayFromBase64(Iterable<String> valuesAsBase64Strings)
public R toBytesArrayFromBase64(Iterable<String> valuesAsBase64Strings)
Binds to Value.bytesArray(values)
. The given strings must be valid base64 encoded
strings. Use this method instead of #toBytesArray(Iterable) if you already have the
values in base64 format to prevent unnecessary decoding and encoding to/from base64.
Returns |
Type |
Description |
R |
|
toDateArray(Iterable<Date> values)
public R toDateArray(Iterable<Date> values)
Binds to Value.dateArray(values)
Parameter |
Name |
Description |
values |
Iterable<com.google.cloud.Date>
|
Returns |
Type |
Description |
R |
|
toFloat32Array(float[] values)
public R toFloat32Array(float[] values)
Binds to Value.float32Array(values)
Parameter |
Name |
Description |
values |
float[]
|
Returns |
Type |
Description |
R |
|
toFloat32Array(float[] values, int pos, int length)
public R toFloat32Array(float[] values, int pos, int length)
Binds to Value.float32Array(values, pos, length)
Parameters |
Name |
Description |
values |
float[]
|
pos |
int
|
length |
int
|
Returns |
Type |
Description |
R |
|
toFloat32Array(Iterable<Float> values)
public R toFloat32Array(Iterable<Float> values)
Binds to Value.float32Array(values)
Returns |
Type |
Description |
R |
|
toFloat64Array(double[] values)
public R toFloat64Array(double[] values)
Binds to Value.float64Array(values)
Parameter |
Name |
Description |
values |
double[]
|
Returns |
Type |
Description |
R |
|
toFloat64Array(double[] values, int pos, int length)
public R toFloat64Array(double[] values, int pos, int length)
Binds to Value.float64Array(values, pos, length)
Parameters |
Name |
Description |
values |
double[]
|
pos |
int
|
length |
int
|
Returns |
Type |
Description |
R |
|
toFloat64Array(Iterable<Double> values)
public R toFloat64Array(Iterable<Double> values)
Binds to Value.float64Array(values)
Returns |
Type |
Description |
R |
|
toInt64Array(Iterable<Long> values)
public R toInt64Array(Iterable<Long> values)
Binds to Value.int64Array(values)
Returns |
Type |
Description |
R |
|
toInt64Array(long[] values)
public R toInt64Array(long[] values)
Binds to Value.int64Array(values)
Parameter |
Name |
Description |
values |
long[]
|
Returns |
Type |
Description |
R |
|
toInt64Array(long[] values, int pos, int length)
public R toInt64Array(long[] values, int pos, int length)
Binds to Value.int64Array(values, pos, length)
Parameters |
Name |
Description |
values |
long[]
|
pos |
int
|
length |
int
|
Returns |
Type |
Description |
R |
|
toJsonArray(Iterable<String> values)
public R toJsonArray(Iterable<String> values)
Binds to Value.jsonArray(values)
Returns |
Type |
Description |
R |
|
toNumericArray(Iterable<BigDecimal> values)
public R toNumericArray(Iterable<BigDecimal> values)
Binds to Value.numericArray(values)
Returns |
Type |
Description |
R |
|
toPgJsonbArray(Iterable<String> values)
public R toPgJsonbArray(Iterable<String> values)
Binds to Value.jsonbArray(values)
Returns |
Type |
Description |
R |
|
toPgNumericArray(Iterable<String> values)
public R toPgNumericArray(Iterable<String> values)
Binds to Value.pgNumericArray(values)
Returns |
Type |
Description |
R |
|
toPgOidArray(Iterable<Long> values)
public R toPgOidArray(Iterable<Long> values)
Binds to Value.pgOidArray(values)
Returns |
Type |
Description |
R |
|
toPgOidArray(long[] values)
public R toPgOidArray(long[] values)
Binds to Value.pgOidArray(values)
Parameter |
Name |
Description |
values |
long[]
|
Returns |
Type |
Description |
R |
|
toPgOidArray(long[] values, int pos, int length)
public R toPgOidArray(long[] values, int pos, int length)
Binds to Value.pgOidArray(values, pos, length)
Parameters |
Name |
Description |
values |
long[]
|
pos |
int
|
length |
int
|
Returns |
Type |
Description |
R |
|
toProtoEnumArray(Iterable<ProtocolMessageEnum> values, Descriptors.EnumDescriptor descriptor)
public R toProtoEnumArray(Iterable<ProtocolMessageEnum> values, Descriptors.EnumDescriptor descriptor)
Binds to Value.protoEnumArray(values, descriptor)
Returns |
Type |
Description |
R |
|
toProtoEnumArray(Iterable<Long> values, String protoTypeFq)
public R toProtoEnumArray(Iterable<Long> values, String protoTypeFq)
Binds to Value.protoEnumArray(values, protoTypeFq)
Returns |
Type |
Description |
R |
|
toProtoMessageArray(Iterable<ByteArray> values, String protoTypeFq)
public R toProtoMessageArray(Iterable<ByteArray> values, String protoTypeFq)
Binds to Value.protoMessageArray(values, protoTypeFq)
Parameters |
Name |
Description |
values |
Iterable<com.google.cloud.ByteArray>
|
protoTypeFq |
String
|
Returns |
Type |
Description |
R |
|
toProtoMessageArray(Iterable<AbstractMessage> values, Descriptors.Descriptor descriptor)
public R toProtoMessageArray(Iterable<AbstractMessage> values, Descriptors.Descriptor descriptor)
Binds to Value.protoMessageArray(values, descriptor)
Returns |
Type |
Description |
R |
|
toStringArray(Iterable<String> values)
public R toStringArray(Iterable<String> values)
Binds to Value.stringArray(values)
Returns |
Type |
Description |
R |
|
toStructArray(Type elementType, Iterable<Struct> values)
public R toStructArray(Type elementType, Iterable<Struct> values)
Binds to Value.structArray(fieldTypes, values)
Returns |
Type |
Description |
R |
|
toTimestampArray(Iterable<Timestamp> values)
public R toTimestampArray(Iterable<Timestamp> values)
Binds to Value.timestampArray(values)
Parameter |
Name |
Description |
values |
Iterable<com.google.cloud.Timestamp>
|
Returns |
Type |
Description |
R |
|