public interface SettableById<SelfT extends SettableById<SelfT>> extends SettableByIndex<SelfT>, AccessibleById
Modifier and Type | Method and Description |
---|---|
default DataType |
getType(CqlIdentifier id)
Returns the CQL type of the value for the first occurrence of
id . |
default <ValueT> SelfT |
set(CqlIdentifier id,
ValueT v,
Class<ValueT> targetClass)
Returns the value for all occurrences of
id , converting it to the given Java type. |
default <ValueT> SelfT |
set(CqlIdentifier id,
ValueT v,
GenericType<ValueT> targetType)
Sets the value for all occurrences of
id , converting it to the given Java type. |
default <ValueT> SelfT |
set(CqlIdentifier id,
ValueT v,
TypeCodec<ValueT> codec)
Sets the value for all occurrences of
id , using the given codec for the conversion. |
default SelfT |
setBigDecimal(CqlIdentifier id,
BigDecimal v)
Sets the value for all occurrences of
id to the provided Java big decimal. |
default SelfT |
setBigInteger(CqlIdentifier id,
BigInteger v)
Sets the value for all occurrences of
id to the provided Java big integer. |
default SelfT |
setBool(CqlIdentifier id,
boolean v)
Deprecated.
this method only exists to ease the transition from driver 3, it is an alias for
setBoolean(CqlIdentifier, boolean) . |
default SelfT |
setBoolean(CqlIdentifier id,
boolean v)
Sets the value for all occurrences of
id to the provided Java primitive boolean. |
default SelfT |
setByte(CqlIdentifier id,
byte v)
Sets the value for all occurrences of
id to the provided Java primitive byte. |
default SelfT |
setByteBuffer(CqlIdentifier id,
ByteBuffer v)
Sets the value for all occurrences of
id to the provided Java byte buffer. |
default SelfT |
setBytesUnsafe(CqlIdentifier id,
ByteBuffer v)
Sets the raw binary representation of the value for all occurrences of
id . |
default SelfT |
setCqlDuration(CqlIdentifier id,
CqlDuration v)
Sets the value for all occurrences of
id to the provided duration. |
default SelfT |
setDouble(CqlIdentifier id,
double v)
Sets the value for all occurrences of
id to the provided Java primitive double. |
default SelfT |
setFloat(CqlIdentifier id,
float v)
Sets the value for all occurrences of
id to the provided Java primitive float. |
default SelfT |
setInetAddress(CqlIdentifier id,
InetAddress v)
Sets the value for all occurrences of
id to the provided Java IP address. |
default SelfT |
setInstant(CqlIdentifier id,
Instant v)
Sets the value for all occurrences of
id to the provided Java instant. |
default SelfT |
setInt(CqlIdentifier id,
int v)
Sets the value for all occurrences of
id to the provided Java primitive integer. |
default <ElementT> SelfT |
setList(CqlIdentifier id,
List<ElementT> v,
Class<ElementT> elementsClass)
Sets the value for all occurrences of
id to the provided Java list. |
default SelfT |
setLocalDate(CqlIdentifier id,
LocalDate v)
Sets the value for all occurrences of
id to the provided Java local date. |
default SelfT |
setLocalTime(CqlIdentifier id,
LocalTime v)
Sets the value for all occurrences of
id to the provided Java local time. |
default SelfT |
setLong(CqlIdentifier id,
long v)
Sets the value for all occurrences of
id to the provided Java primitive long. |
default <KeyT,ValueT> |
setMap(CqlIdentifier id,
Map<KeyT,ValueT> v,
Class<KeyT> keyClass,
Class<ValueT> valueClass)
Sets the value for all occurrences of
id to the provided Java map. |
default <ElementT> SelfT |
setSet(CqlIdentifier id,
Set<ElementT> v,
Class<ElementT> elementsClass)
Sets the value for all occurrences of
id to the provided Java set. |
default SelfT |
setShort(CqlIdentifier id,
short v)
Sets the value for all occurrences of
id to the provided Java primitive short. |
default SelfT |
setString(CqlIdentifier id,
String v)
Sets the value for all occurrences of
id to the provided Java string. |
default SelfT |
setToken(CqlIdentifier id,
Token v)
Sets the value for all occurrences of
id to the provided token. |
default SelfT |
setToNull(CqlIdentifier id)
Sets the value for all occurrences of
id to CQL NULL . |
default SelfT |
setTupleValue(CqlIdentifier id,
TupleValue v)
Sets the value for all occurrences of
id to the provided tuple value. |
default SelfT |
setUdtValue(CqlIdentifier id,
UdtValue v)
Sets the value for all occurrences of
id to the provided user defined type value. |
default SelfT |
setUuid(CqlIdentifier id,
UUID v)
Sets the value for all occurrences of
id to the provided Java UUID. |
set, set, set, setBigDecimal, setBigInteger, setBool, setBoolean, setByte, setByteBuffer, setBytesUnsafe, setCqlDuration, setDouble, setFloat, setInetAddress, setInstant, setInt, setList, setLocalDate, setLocalTime, setLong, setMap, setSet, setShort, setString, setToken, setToNull, setTupleValue, setUdtValue, setUuid
allIndicesOf, firstIndexOf
getType, size
codecRegistry, protocolVersion
@NonNull @CheckReturnValue default SelfT setBytesUnsafe(@NonNull CqlIdentifier id, @Nullable ByteBuffer v)
id
.
This is primarily for internal use; you'll likely want to use one of the typed setters instead, to pass a higher-level Java representation.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
v
- the raw value, or null
to set the CQL value NULL
. For performance
reasons, this is the actual instance used internally. If pass in a buffer that you're going
to modify elsewhere in your application, make sure to duplicate
it beforehand. If you change the buffer's index or its contents in any way,
further usage of this data will have unpredictable results.IllegalArgumentException
- if the id is invalid.@NonNull default DataType getType(@NonNull CqlIdentifier id)
AccessibleById
id
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
getType
in interface AccessibleById
@NonNull @CheckReturnValue default SelfT setToNull(@NonNull CqlIdentifier id)
id
to CQL NULL
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default <ValueT> SelfT set(@NonNull CqlIdentifier id, @Nullable ValueT v, @NonNull TypeCodec<ValueT> codec)
id
, using the given codec for the conversion.
This method completely bypasses the Data.codecRegistry()
, and forces the driver to use
the given codec instead. This can be useful if the codec would collide with a previously
registered one, or if you want to use the codec just once without registering it.
It is the caller's responsibility to ensure that the given codec is appropriate for the conversion. Failing to do so will result in errors at runtime.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default <ValueT> SelfT set(@NonNull CqlIdentifier id, @Nullable ValueT v, @NonNull GenericType<ValueT> targetType)
id
, converting it to the given Java type.
The Data.codecRegistry()
will be used to look up a codec to handle the conversion.
This variant is for generic Java types. If the target type is not generic, use SettableByIndex.set(int, Object, Class)
instead, which may perform slightly better.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.CodecNotFoundException
- if no codec can perform the conversion.@NonNull @CheckReturnValue default <ValueT> SelfT set(@NonNull CqlIdentifier id, @Nullable ValueT v, @NonNull Class<ValueT> targetClass)
id
, converting it to the given Java type.
The Data.codecRegistry()
will be used to look up a codec to handle the conversion.
If the target type is generic, use SettableByIndex.set(int, Object, GenericType)
instead.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.CodecNotFoundException
- if no codec can perform the conversion.@NonNull @CheckReturnValue default SelfT setBoolean(@NonNull CqlIdentifier id, boolean v)
id
to the provided Java primitive boolean.
By default, this works with CQL type boolean
.
To set the value to CQL NULL
, use SettableByIndex.setToNull(int)
, or set(i, v,
Boolean.class)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@Deprecated @NonNull @CheckReturnValue default SelfT setBool(@NonNull CqlIdentifier id, boolean v)
setBoolean(CqlIdentifier, boolean)
.@NonNull @CheckReturnValue default SelfT setByte(@NonNull CqlIdentifier id, byte v)
id
to the provided Java primitive byte.
By default, this works with CQL type tinyint
.
To set the value to CQL NULL
, use SettableByIndex.setToNull(int)
, or set(i, v,
Boolean.class)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setDouble(@NonNull CqlIdentifier id, double v)
id
to the provided Java primitive double.
By default, this works with CQL type double
.
To set the value to CQL NULL
, use SettableByIndex.setToNull(int)
, or set(i, v,
Double.class)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setFloat(@NonNull CqlIdentifier id, float v)
id
to the provided Java primitive float.
By default, this works with CQL type float
.
To set the value to CQL NULL
, use SettableByIndex.setToNull(int)
, or set(i, v,
Float.class)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setInt(@NonNull CqlIdentifier id, int v)
id
to the provided Java primitive integer.
By default, this works with CQL type int
.
To set the value to CQL NULL
, use SettableByIndex.setToNull(int)
, or set(i, v,
Integer.class)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setLong(@NonNull CqlIdentifier id, long v)
id
to the provided Java primitive long.
By default, this works with CQL types bigint
and counter
.
To set the value to CQL NULL
, use SettableByIndex.setToNull(int)
, or set(i, v,
Long.class)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setShort(@NonNull CqlIdentifier id, short v)
id
to the provided Java primitive short.
By default, this works with CQL type smallint
.
To set the value to CQL NULL
, use SettableByIndex.setToNull(int)
, or set(i, v,
Short.class)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setInstant(@NonNull CqlIdentifier id, @Nullable Instant v)
id
to the provided Java instant.
By default, this works with CQL type timestamp
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setLocalDate(@NonNull CqlIdentifier id, @Nullable LocalDate v)
id
to the provided Java local date.
By default, this works with CQL type date
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setLocalTime(@NonNull CqlIdentifier id, @Nullable LocalTime v)
id
to the provided Java local time.
By default, this works with CQL type time
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setByteBuffer(@NonNull CqlIdentifier id, @Nullable ByteBuffer v)
id
to the provided Java byte buffer.
By default, this works with CQL type blob
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setString(@NonNull CqlIdentifier id, @Nullable String v)
id
to the provided Java string.
By default, this works with CQL types text
, varchar
and ascii
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setBigInteger(@NonNull CqlIdentifier id, @Nullable BigInteger v)
id
to the provided Java big integer.
By default, this works with CQL type varint
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setBigDecimal(@NonNull CqlIdentifier id, @Nullable BigDecimal v)
id
to the provided Java big decimal.
By default, this works with CQL type decimal
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setUuid(@NonNull CqlIdentifier id, @Nullable UUID v)
id
to the provided Java UUID.
By default, this works with CQL types uuid
and timeuuid
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setInetAddress(@NonNull CqlIdentifier id, @Nullable InetAddress v)
id
to the provided Java IP address.
By default, this works with CQL type inet
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setCqlDuration(@NonNull CqlIdentifier id, @Nullable CqlDuration v)
id
to the provided duration.
By default, this works with CQL type duration
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setToken(@NonNull CqlIdentifier id, @NonNull Token v)
id
to the provided token.
This works with the CQL type matching the partitioner in use for this cluster: bigint
for Murmur3Partitioner
, blob
for ByteOrderedPartitioner
, and
varint
for RandomPartitioner
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the index is invalid.@NonNull @CheckReturnValue default <ElementT> SelfT setList(@NonNull CqlIdentifier id, @Nullable List<ElementT> v, @NonNull Class<ElementT> elementsClass)
id
to the provided Java list.
By default, this works with CQL type list
.
This method is provided for convenience when the element type is a non-generic type. For
more complex list types, use SettableByIndex.set(int, Object, GenericType)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default <ElementT> SelfT setSet(@NonNull CqlIdentifier id, @Nullable Set<ElementT> v, @NonNull Class<ElementT> elementsClass)
id
to the provided Java set.
By default, this works with CQL type set
.
This method is provided for convenience when the element type is a non-generic type. For
more complex set types, use SettableByIndex.set(int, Object, GenericType)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default <KeyT,ValueT> SelfT setMap(@NonNull CqlIdentifier id, @Nullable Map<KeyT,ValueT> v, @NonNull Class<KeyT> keyClass, @NonNull Class<ValueT> valueClass)
id
to the provided Java map.
By default, this works with CQL type map
.
This method is provided for convenience when the element type is a non-generic type. For
more complex map types, use SettableByIndex.set(int, Object, GenericType)
.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setUdtValue(@NonNull CqlIdentifier id, @Nullable UdtValue v)
id
to the provided user defined type value.
By default, this works with CQL user-defined types.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.@NonNull @CheckReturnValue default SelfT setTupleValue(@NonNull CqlIdentifier id, @Nullable TupleValue v)
id
to the provided tuple value.
By default, this works with CQL tuples.
If you want to avoid the overhead of building a CqlIdentifier
, use the variant of
this method that takes a string argument.
IllegalArgumentException
- if the id is invalid.Copyright © 2017–2024. All rights reserved.