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 aValuein some context. Users of the Cloud Spanner client library never create aValueBinderdirectly; instead this interface is returned from other parts of the library involved inValueconstruction. 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.ValueBindersubclasses 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 Rto(boolean value)Binds toValue.bool(value)Rto(double value)Binds toValue.float64(value)Rto(long value)Binds toValue.int64(value)Rto(com.google.cloud.ByteArray value)Binds toValue.bytes(value).Rto(com.google.cloud.Date value)Binds toValue.date(value)Rto(Struct value)Binds a non-NULLstruct value toValue.struct(value)Rto(Type type, Struct value)Binds a nullableStructreference with givenTypetoValue.struct(type,valueRto(Value value)Binds aValueRto(com.google.cloud.Timestamp value)Binds toValue.timestamp(value)Rto(Boolean value)Binds toValue.bool(value)Rto(Double value)Binds toValue.float64(value)Rto(Long value)Binds toValue.int64(value)Rto(String value)Binds toValue.string(value)Rto(BigDecimal value)Binds toValue.numeric(value)RtoBoolArray(boolean[] values)Binds toValue.boolArray(values)RtoBoolArray(boolean[] values, int pos, int length)Binds toValue.boolArray(values, int, pos)RtoBoolArray(Iterable<Boolean> values)Binds toValue.boolArray(values)RtoBytesArray(Iterable<com.google.cloud.ByteArray> values)Binds toValue.bytesArray(values)RtoBytesArrayFromBase64(Iterable<String> valuesAsBase64Strings)Binds toValue.bytesArray(values).RtoDateArray(Iterable<com.google.cloud.Date> values)Binds toValue.dateArray(values)RtoFloat64Array(double[] values)Binds toValue.float64Array(values)RtoFloat64Array(double[] values, int pos, int length)Binds toValue.float64Array(values, pos, length)RtoFloat64Array(Iterable<Double> values)Binds toValue.float64Array(values)RtoInt64Array(long[] values)Binds toValue.int64Array(values)RtoInt64Array(long[] values, int pos, int length)Binds toValue.int64Array(values, pos, length)RtoInt64Array(Iterable<Long> values)Binds toValue.int64Array(values)RtoJsonArray(Iterable<String> values)Binds toValue.jsonArray(values)RtoNumericArray(Iterable<BigDecimal> values)Binds toValue.numericArray(values)RtoPgJsonbArray(Iterable<String> values)Binds toValue.jsonbArray(values)RtoPgNumericArray(Iterable<String> values)Binds toValue.pgNumericArray(values)RtoStringArray(Iterable<String> values)Binds toValue.stringArray(values)RtoStructArray(Type elementType, Iterable<Struct> values)Binds toValue.structArray(fieldTypes, values)RtoTimestampArray(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(@Nullable com.google.cloud.ByteArray value)
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
public R to(Type type, @Nullable Struct value)
Binds a nullableStructreference with givenTypetoValue.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)
-
toPgJsonbArray
public R toPgJsonbArray(@Nullable Iterable<String> values)
Binds toValue.jsonbArray(values)
-
toBytesArray
public R toBytesArray(@Nullable Iterable<com.google.cloud.ByteArray> values)
Binds toValue.bytesArray(values)
-
toBytesArrayFromBase64
public R toBytesArrayFromBase64(@Nullable Iterable<String> valuesAsBase64Strings)
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
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)
-
-