Package com.google.cloud.spanner
Class ValueBinder<R>
- java.lang.Object
-
- com.google.cloud.spanner.ValueBinder<R>
-
public abstract class ValueBinder<R> extends Object
An interface for binding aValue
in some context. Users of the Cloud Spanner client library never create aValueBinder
directly; instead this interface is returned from other parts of the library involved inValue
construction. For example,Mutation.WriteBuilder.set(String)
returns a binder to bind a column value, andStatement#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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
to(boolean value)
Binds toValue.bool(value)
R
to(double value)
Binds toValue.float64(value)
R
to(long value)
Binds toValue.int64(value)
R
to(com.google.cloud.ByteArray value)
Binds toValue.bytes(value)
R
to(com.google.cloud.Date value)
Binds toValue.date(value)
R
to(Struct value)
Binds a non-NULL
struct value toValue.struct(value)
R
to(Type type, Struct value)
Binds a nullableStruct
reference with givenType
toValue.struct(type,value
R
to(Value value)
Binds aValue
R
to(com.google.cloud.Timestamp value)
Binds toValue.timestamp(value)
R
to(Boolean value)
Binds toValue.bool(value)
R
to(Double value)
Binds toValue.float64(value)
R
to(Long value)
Binds toValue.int64(value)
R
to(String value)
Binds toValue.string(value)
R
to(BigDecimal value)
Binds toValue.numeric(value)
R
toBoolArray(boolean[] values)
Binds toValue.boolArray(values)
R
toBoolArray(boolean[] values, int pos, int length)
Binds toValue.boolArray(values, int, pos)
R
toBoolArray(Iterable<Boolean> values)
Binds toValue.boolArray(values)
R
toBytesArray(Iterable<com.google.cloud.ByteArray> values)
Binds toValue.bytesArray(values)
R
toDateArray(Iterable<com.google.cloud.Date> values)
Binds toValue.dateArray(values)
R
toFloat64Array(double[] values)
Binds toValue.float64Array(values)
R
toFloat64Array(double[] values, int pos, int length)
Binds toValue.float64Array(values, pos, length)
R
toFloat64Array(Iterable<Double> values)
Binds toValue.float64Array(values)
R
toInt64Array(long[] values)
Binds toValue.int64Array(values)
R
toInt64Array(long[] values, int pos, int length)
Binds toValue.int64Array(values, pos, length)
R
toInt64Array(Iterable<Long> values)
Binds toValue.int64Array(values)
R
toJsonArray(Iterable<String> values)
Binds toValue.jsonArray(values)
R
toNumericArray(Iterable<BigDecimal> values)
Binds toValue.numericArray(values)
R
toPgNumericArray(Iterable<String> values)
Binds toValue.pgNumericArray(values)
R
toStringArray(Iterable<String> values)
Binds toValue.stringArray(values)
R
toStructArray(Type elementType, Iterable<Struct> values)
Binds toValue.structArray(fieldTypes, values)
R
toTimestampArray(Iterable<com.google.cloud.Timestamp> values)
Binds toValue.timestampArray(values)
-
-
-
Method Detail
-
to
public R to(boolean value)
Binds toValue.bool(value)
-
to
public R to(long value)
Binds toValue.int64(value)
-
to
public R to(double value)
Binds toValue.float64(value)
-
to
public R to(BigDecimal value)
Binds toValue.numeric(value)
-
to
public R to(Type type, @Nullable Struct value)
Binds a nullableStruct
reference with givenType
toValue.struct(type,value
-
toBoolArray
public R toBoolArray(@Nullable boolean[] values, int pos, int length)
Binds toValue.boolArray(values, int, pos)
-
toBoolArray
public R toBoolArray(@Nullable Iterable<Boolean> values)
Binds toValue.boolArray(values)
-
toInt64Array
public R toInt64Array(@Nullable long[] values, int pos, int length)
Binds toValue.int64Array(values, pos, length)
-
toInt64Array
public R toInt64Array(@Nullable Iterable<Long> values)
Binds toValue.int64Array(values)
-
toFloat64Array
public R toFloat64Array(@Nullable double[] values)
Binds toValue.float64Array(values)
-
toFloat64Array
public R toFloat64Array(@Nullable double[] values, int pos, int length)
Binds toValue.float64Array(values, pos, length)
-
toFloat64Array
public R toFloat64Array(@Nullable Iterable<Double> values)
Binds toValue.float64Array(values)
-
toNumericArray
public R toNumericArray(@Nullable Iterable<BigDecimal> values)
Binds toValue.numericArray(values)
-
toPgNumericArray
public R toPgNumericArray(@Nullable Iterable<String> values)
Binds toValue.pgNumericArray(values)
-
toStringArray
public R toStringArray(@Nullable Iterable<String> values)
Binds toValue.stringArray(values)
-
toJsonArray
public R toJsonArray(@Nullable Iterable<String> values)
Binds toValue.jsonArray(values)
-
toBytesArray
public R toBytesArray(@Nullable Iterable<com.google.cloud.ByteArray> values)
Binds toValue.bytesArray(values)
-
toTimestampArray
public R toTimestampArray(@Nullable Iterable<com.google.cloud.Timestamp> values)
Binds toValue.timestampArray(values)
-
toDateArray
public R toDateArray(@Nullable Iterable<com.google.cloud.Date> values)
Binds toValue.dateArray(values)
-
-