Class ValueBinder<R> (6.57.0)

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.

Inheritance

java.lang.Object > ValueBinder<R>

Type Parameter

NameDescription
R

Methods

to(boolean value)

public R to(boolean value)

Binds to Value.bool(value)

Parameter
NameDescription
valueboolean
Returns
TypeDescription
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
NameDescription
valuecom.google.cloud.ByteArray
Returns
TypeDescription
R

to(ByteArray v, Descriptors.Descriptor descriptor)

public R to(ByteArray v, Descriptors.Descriptor descriptor)

Binds to Value.protoMessage(value, descriptor)

Parameters
NameDescription
vcom.google.cloud.ByteArray
descriptorDescriptor
Returns
TypeDescription
R

to(ByteArray v, String protoTypFqn)

public R to(ByteArray v, String protoTypFqn)

Binds to Value.protoMessage(value, protoType)

Parameters
NameDescription
vcom.google.cloud.ByteArray
protoTypFqnString
Returns
TypeDescription
R

to(Date value)

public R to(Date value)

Binds to Value.date(value)

Parameter
NameDescription
valuecom.google.cloud.Date
Returns
TypeDescription
R

to(Timestamp value)

public R to(Timestamp value)

Binds to Value.timestamp(value)

Parameter
NameDescription
valuecom.google.cloud.Timestamp
Returns
TypeDescription
R

to(Struct value)

public R to(Struct value)

Binds a non-NULL struct value to Value.struct(value)

Parameter
NameDescription
valueStruct
Returns
TypeDescription
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
NameDescription
typeType
valueStruct
Returns
TypeDescription
R

to(Value value)

public R to(Value value)

Binds a Value

Parameter
NameDescription
valueValue
Returns
TypeDescription
R

to(AbstractMessage m)

public R to(AbstractMessage m)

Binds to Value.protoMessage(value)

Parameter
NameDescription
mAbstractMessage
Returns
TypeDescription
R

to(ProtocolMessageEnum value)

public R to(ProtocolMessageEnum value)

Binds to Value.protoEnum(value)

Parameter
NameDescription
valueProtocolMessageEnum
Returns
TypeDescription
R

to(double value)

public R to(double value)

Binds to Value.float64(value)

Parameter
NameDescription
valuedouble
Returns
TypeDescription
R

to(Boolean value)

public R to(Boolean value)

Binds to Value.bool(value)

Parameter
NameDescription
valueBoolean
Returns
TypeDescription
R

to(Double value)

public R to(Double value)

Binds to Value.float64(value)

Parameter
NameDescription
valueDouble
Returns
TypeDescription
R

to(Long value)

public R to(Long value)

Binds to Value.int64(value)

Parameter
NameDescription
valueLong
Returns
TypeDescription
R

to(Long v, Descriptors.EnumDescriptor enumDescriptor)

public R to(Long v, Descriptors.EnumDescriptor enumDescriptor)

Binds to Value.protoEnum(value, enumDescriptor)

Parameters
NameDescription
vLong
enumDescriptorEnumDescriptor
Returns
TypeDescription
R

to(Long v, String protoTypFqn)

public R to(Long v, String protoTypFqn)

Binds to Value.protoEnum(value, protoType)

Parameters
NameDescription
vLong
protoTypFqnString
Returns
TypeDescription
R

to(String value)

public R to(String value)

Binds to Value.string(value)

Parameter
NameDescription
valueString
Returns
TypeDescription
R

to(BigDecimal value)

public R to(BigDecimal value)

Binds to Value.numeric(value)

Parameter
NameDescription
valueBigDecimal
Returns
TypeDescription
R

to(long value)

public R to(long value)

Binds to Value.int64(value)

Parameter
NameDescription
valuelong
Returns
TypeDescription
R

to(long v, String protoTypFqn)

public R to(long v, String protoTypFqn)

Binds to Value.protoEnum(value, protoType)

Parameters
NameDescription
vlong
protoTypFqnString
Returns
TypeDescription
R

toBoolArray(boolean[] values)

public R toBoolArray(boolean[] values)

Binds to Value.boolArray(values)

Parameter
NameDescription
valuesboolean[]
Returns
TypeDescription
R

toBoolArray(boolean[] values, int pos, int length)

public R toBoolArray(boolean[] values, int pos, int length)

Binds to Value.boolArray(values, int, pos)

Parameters
NameDescription
valuesboolean[]
posint
lengthint
Returns
TypeDescription
R

toBoolArray(Iterable<Boolean> values)

public R toBoolArray(Iterable<Boolean> values)

Binds to Value.boolArray(values)

Parameter
NameDescription
valuesIterable<Boolean>
Returns
TypeDescription
R

toBytesArray(Iterable<ByteArray> values)

public R toBytesArray(Iterable<ByteArray> values)

Binds to Value.bytesArray(values)

Parameter
NameDescription
valuesIterable<com.google.cloud.ByteArray>
Returns
TypeDescription
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.

Parameter
NameDescription
valuesAsBase64StringsIterable<String>
Returns
TypeDescription
R

toDateArray(Iterable<Date> values)

public R toDateArray(Iterable<Date> values)

Binds to Value.dateArray(values)

Parameter
NameDescription
valuesIterable<com.google.cloud.Date>
Returns
TypeDescription
R

toFloat64Array(double[] values)

public R toFloat64Array(double[] values)

Binds to Value.float64Array(values)

Parameter
NameDescription
valuesdouble[]
Returns
TypeDescription
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
NameDescription
valuesdouble[]
posint
lengthint
Returns
TypeDescription
R

toFloat64Array(Iterable<Double> values)

public R toFloat64Array(Iterable<Double> values)

Binds to Value.float64Array(values)

Parameter
NameDescription
valuesIterable<Double>
Returns
TypeDescription
R

toInt64Array(Iterable<Long> values)

public R toInt64Array(Iterable<Long> values)

Binds to Value.int64Array(values)

Parameter
NameDescription
valuesIterable<Long>
Returns
TypeDescription
R

toInt64Array(long[] values)

public R toInt64Array(long[] values)

Binds to Value.int64Array(values)

Parameter
NameDescription
valueslong[]
Returns
TypeDescription
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
NameDescription
valueslong[]
posint
lengthint
Returns
TypeDescription
R

toJsonArray(Iterable<String> values)

public R toJsonArray(Iterable<String> values)

Binds to Value.jsonArray(values)

Parameter
NameDescription
valuesIterable<String>
Returns
TypeDescription
R

toNumericArray(Iterable<BigDecimal> values)

public R toNumericArray(Iterable<BigDecimal> values)

Binds to Value.numericArray(values)

Parameter
NameDescription
valuesIterable<BigDecimal>
Returns
TypeDescription
R

toPgJsonbArray(Iterable<String> values)

public R toPgJsonbArray(Iterable<String> values)

Binds to Value.jsonbArray(values)

Parameter
NameDescription
valuesIterable<String>
Returns
TypeDescription
R

toPgNumericArray(Iterable<String> values)

public R toPgNumericArray(Iterable<String> values)

Binds to Value.pgNumericArray(values)

Parameter
NameDescription
valuesIterable<String>
Returns
TypeDescription
R

toProtoEnumArray(Iterable<ProtocolMessageEnum> values, Descriptors.EnumDescriptor descriptor)

public R toProtoEnumArray(Iterable<ProtocolMessageEnum> values, Descriptors.EnumDescriptor descriptor)

Binds to Value.protoEnumArray(values, descriptor)

Parameters
NameDescription
valuesIterable<ProtocolMessageEnum>
descriptorEnumDescriptor
Returns
TypeDescription
R

toProtoEnumArray(Iterable<Long> values, String protoTypeFq)

public R toProtoEnumArray(Iterable<Long> values, String protoTypeFq)

Binds to Value.protoEnumArray(values, protoTypeFq)

Parameters
NameDescription
valuesIterable<Long>
protoTypeFqString
Returns
TypeDescription
R

toProtoMessageArray(Iterable<ByteArray> values, String protoTypeFq)

public R toProtoMessageArray(Iterable<ByteArray> values, String protoTypeFq)

Binds to Value.protoMessageArray(values, protoTypeFq)

Parameters
NameDescription
valuesIterable<com.google.cloud.ByteArray>
protoTypeFqString
Returns
TypeDescription
R

toProtoMessageArray(Iterable<AbstractMessage> values, Descriptors.Descriptor descriptor)

public R toProtoMessageArray(Iterable<AbstractMessage> values, Descriptors.Descriptor descriptor)

Binds to Value.protoMessageArray(values, descriptor)

Parameters
NameDescription
valuesIterable<AbstractMessage>
descriptorDescriptor
Returns
TypeDescription
R

toStringArray(Iterable<String> values)

public R toStringArray(Iterable<String> values)

Binds to Value.stringArray(values)

Parameter
NameDescription
valuesIterable<String>
Returns
TypeDescription
R

toStructArray(Type elementType, Iterable<Struct> values)

public R toStructArray(Type elementType, Iterable<Struct> values)

Binds to Value.structArray(fieldTypes, values)

Parameters
NameDescription
elementTypeType
valuesIterable<Struct>
Returns
TypeDescription
R

toTimestampArray(Iterable<Timestamp> values)

public R toTimestampArray(Iterable<Timestamp> values)

Binds to Value.timestampArray(values)

Parameter
NameDescription
valuesIterable<com.google.cloud.Timestamp>
Returns
TypeDescription
R