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
|
to(ByteArray value)
public R to(ByteArray value)
Binds to Value.bytes(value)
Parameter |
---|
Name | Description |
value | com.google.cloud.ByteArray
|
to(Date value)
Binds to Value.date(value)
Parameter |
---|
Name | Description |
value | com.google.cloud.Date
|
to(Timestamp value)
public R to(Timestamp value)
Binds to Value.timestamp(value)
Parameter |
---|
Name | Description |
value | com.google.cloud.Timestamp
|
to(Struct value)
public R to(Struct value)
Binds a non-NULL
struct value to Value.struct(value)
Parameter |
---|
Name | Description |
value | Struct
|
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
to(Value value)
Parameter |
---|
Name | Description |
value | Value
|
to(double value)
public R to(double value)
Binds to Value.float64(value)
Parameter |
---|
Name | Description |
value | double
|
to(Boolean value)
public R to(Boolean value)
Binds to Value.bool(value)
Parameter |
---|
Name | Description |
value | Boolean
|
to(Double value)
public R to(Double value)
Binds to Value.float64(value)
Parameter |
---|
Name | Description |
value | Double
|
to(Long value)
Binds to Value.int64(value)
Parameter |
---|
Name | Description |
value | Long
|
to(String value)
public R to(String value)
Binds to Value.string(value)
Parameter |
---|
Name | Description |
value | String
|
to(BigDecimal value)
public R to(BigDecimal value)
Binds to Value.numeric(value)
to(long value)
Binds to Value.int64(value)
Parameter |
---|
Name | Description |
value | long
|
toBoolArray(boolean[] values)
public R toBoolArray(boolean[] values)
Binds to Value.boolArray(values)
Parameter |
---|
Name | Description |
values | boolean[]
|
toBoolArray(boolean[] values, int pos, int length)
public R toBoolArray(boolean[] values, int pos, int length)
Binds to Value.boolArray(values, int, pos)
toBoolArray(Iterable<Boolean> values)
public R toBoolArray(Iterable<Boolean> values)
Binds to Value.boolArray(values)
toBytesArray(Iterable<ByteArray> values)
public R toBytesArray(Iterable<ByteArray> values)
Binds to Value.bytesArray(values)
Parameter |
---|
Name | Description |
values | Iterable<com.google.cloud.ByteArray>
|
toDateArray(Iterable<Date> values)
public R toDateArray(Iterable<Date> values)
Binds to Value.dateArray(values)
Parameter |
---|
Name | Description |
values | Iterable<com.google.cloud.Date>
|
toFloat64Array(double[] values)
public R toFloat64Array(double[] values)
Binds to Value.float64Array(values)
Parameter |
---|
Name | Description |
values | double[]
|
toFloat64Array(double[] values, int pos, int length)
public R toFloat64Array(double[] values, int pos, int length)
Binds to Value.float64Array(values, pos, length)
toFloat64Array(Iterable<Double> values)
public R toFloat64Array(Iterable<Double> values)
Binds to Value.float64Array(values)
toInt64Array(Iterable<Long> values)
public R toInt64Array(Iterable<Long> values)
Binds to Value.int64Array(values)
toInt64Array(long[] values)
public R toInt64Array(long[] values)
Binds to Value.int64Array(values)
Parameter |
---|
Name | Description |
values | long[]
|
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
|
toJsonArray(Iterable<String> values)
public R toJsonArray(Iterable<String> values)
Binds to Value.jsonArray(values)
toNumericArray(Iterable<BigDecimal> values)
public R toNumericArray(Iterable<BigDecimal> values)
Binds to Value.numericArray(values)
toPgNumericArray(Iterable<String> values)
public R toPgNumericArray(Iterable<String> values)
Binds to Value.pgNumericArray(values)
toStringArray(Iterable<String> values)
public R toStringArray(Iterable<String> values)
Binds to Value.stringArray(values)
toStructArray(Type elementType, Iterable<Struct> values)
public R toStructArray(Type elementType, Iterable<Struct> values)
Binds to Value.structArray(fieldTypes, values)
toTimestampArray(Iterable<Timestamp> values)
public R toTimestampArray(Iterable<Timestamp> values)
Binds to Value.timestampArray(values)
Parameter |
---|
Name | Description |
values | Iterable<com.google.cloud.Timestamp>
|