public abstract class ValueBinder<R> extends Object
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.
Modifier and Type | Method and Description |
---|---|
R |
to(BigDecimal value)
Binds to
Value.numeric(value) |
R |
to(boolean value)
Binds to
Value.bool(value) |
R |
to(Boolean value)
Binds to
Value.bool(value) |
R |
to(com.google.cloud.ByteArray value)
Binds to
Value.bytes(value) |
R |
to(com.google.cloud.Date value)
Binds to
Value.date(value) |
R |
to(double value)
Binds to
Value.float64(value) |
R |
to(Double value)
Binds to
Value.float64(value) |
R |
to(long value)
Binds to
Value.int64(value) |
R |
to(Long value)
Binds to
Value.int64(value) |
R |
to(String value)
Binds to
Value.string(value) |
R |
to(Struct value)
Binds a non-
NULL struct value to Value.struct(value) |
R |
to(com.google.cloud.Timestamp value)
Binds to
Value.timestamp(value) |
R |
to(Type type,
Struct value)
Binds a nullable
Struct reference with given Type to Value.struct(type,value |
R |
to(Value value)
Binds a
Value |
R |
toBoolArray(boolean[] values)
Binds to
Value.boolArray(values) |
R |
toBoolArray(boolean[] values,
int pos,
int length)
Binds to
Value.boolArray(values, int, pos) |
R |
toBoolArray(Iterable<Boolean> values)
Binds to
Value.boolArray(values) |
R |
toBytesArray(Iterable<com.google.cloud.ByteArray> values)
Binds to
Value.bytesArray(values) |
R |
toDateArray(Iterable<com.google.cloud.Date> values)
Binds to
Value.dateArray(values) |
R |
toFloat64Array(double[] values)
Binds to
Value.float64Array(values) |
R |
toFloat64Array(double[] values,
int pos,
int length)
Binds to
Value.float64Array(values, pos, length) |
R |
toFloat64Array(Iterable<Double> values)
Binds to
Value.float64Array(values) |
R |
toInt64Array(Iterable<Long> values)
Binds to
Value.int64Array(values) |
R |
toInt64Array(long[] values)
Binds to
Value.int64Array(values) |
R |
toInt64Array(long[] values,
int pos,
int length)
Binds to
Value.int64Array(values, pos, length) |
R |
toJsonArray(Iterable<String> values)
Binds to
Value.jsonArray(values) |
R |
toNumericArray(Iterable<BigDecimal> values)
Binds to
Value.numericArray(values) |
R |
toPgNumericArray(Iterable<String> values)
Binds to
Value.pgNumericArray(values) |
R |
toStringArray(Iterable<String> values)
Binds to
Value.stringArray(values) |
R |
toStructArray(Type elementType,
Iterable<Struct> values)
Binds to
Value.structArray(fieldTypes, values) |
R |
toTimestampArray(Iterable<com.google.cloud.Timestamp> values)
Binds to
Value.timestampArray(values) |
public R to(boolean value)
Value.bool(value)
public R to(long value)
Value.int64(value)
public R to(double value)
Value.float64(value)
public R to(BigDecimal value)
Value.numeric(value)
public R to(Type type, @Nullable Struct value)
Struct
reference with given Type
to Value.struct(type,value
public R toBoolArray(@Nullable boolean[] values, int pos, int length)
Value.boolArray(values, int, pos)
public R toBoolArray(@Nullable Iterable<Boolean> values)
Value.boolArray(values)
public R toInt64Array(@Nullable long[] values, int pos, int length)
Value.int64Array(values, pos, length)
public R toInt64Array(@Nullable Iterable<Long> values)
Value.int64Array(values)
public R toFloat64Array(@Nullable double[] values)
Value.float64Array(values)
public R toFloat64Array(@Nullable double[] values, int pos, int length)
Value.float64Array(values, pos, length)
public R toFloat64Array(@Nullable Iterable<Double> values)
Value.float64Array(values)
public R toNumericArray(@Nullable Iterable<BigDecimal> values)
Value.numericArray(values)
public R toPgNumericArray(@Nullable Iterable<String> values)
Value.pgNumericArray(values)
public R toStringArray(@Nullable Iterable<String> values)
Value.stringArray(values)
public R toJsonArray(@Nullable Iterable<String> values)
Value.jsonArray(values)
public R toBytesArray(@Nullable Iterable<com.google.cloud.ByteArray> values)
Value.bytesArray(values)
public R toTimestampArray(@Nullable Iterable<com.google.cloud.Timestamp> values)
Value.timestampArray(values)
public R toDateArray(@Nullable Iterable<com.google.cloud.Date> values)
Value.dateArray(values)
Copyright © 2022 Google LLC. All rights reserved.