public interface SettableByIndex<SelfT extends SettableByIndex<SelfT>> extends AccessibleByIndex
Modifier and Type | Method and Description |
---|---|
default <ValueT> SelfT |
set(int i,
ValueT v,
Class<ValueT> targetClass)
Returns the
i th value, converting it to the given Java type. |
default <ValueT> SelfT |
set(int i,
ValueT v,
GenericType<ValueT> targetType)
Sets the
i th value, converting it to the given Java type. |
default <ValueT> SelfT |
set(int i,
ValueT v,
TypeCodec<ValueT> codec)
Sets the
i th value, using the given codec for the conversion. |
default SelfT |
setBigDecimal(int i,
BigDecimal v)
Sets the
i th value to the provided Java big decimal. |
default SelfT |
setBigInteger(int i,
BigInteger v)
Sets the
i th value to the provided Java big integer. |
default SelfT |
setBool(int i,
boolean v)
Deprecated.
this method only exists to ease the transition from driver 3, it is an alias for
setBoolean(int, boolean) . |
default SelfT |
setBoolean(int i,
boolean v)
Sets the
i th value to the provided Java primitive boolean. |
default SelfT |
setByte(int i,
byte v)
Sets the
i th value to the provided Java primitive byte. |
default SelfT |
setByteBuffer(int i,
ByteBuffer v)
Sets the
i th value to the provided Java byte buffer. |
SelfT |
setBytesUnsafe(int i,
ByteBuffer v)
Sets the raw binary representation of the
i th value. |
default SelfT |
setCqlDuration(int i,
CqlDuration v)
Sets the
i th value to the provided duration. |
default SelfT |
setDouble(int i,
double v)
Sets the
i th value to the provided Java primitive double. |
default SelfT |
setFloat(int i,
float v)
Sets the
i th value to the provided Java primitive float. |
default SelfT |
setInetAddress(int i,
InetAddress v)
Sets the
i th value to the provided Java IP address. |
default SelfT |
setInstant(int i,
Instant v)
Sets the
i th value to the provided Java instant. |
default SelfT |
setInt(int i,
int v)
Sets the
i th value to the provided Java primitive integer. |
default <ElementT> SelfT |
setList(int i,
List<ElementT> v,
Class<ElementT> elementsClass)
Sets the
i th value to the provided Java list. |
default SelfT |
setLocalDate(int i,
LocalDate v)
Sets the
i th value to the provided Java local date. |
default SelfT |
setLocalTime(int i,
LocalTime v)
Sets the
i th value to the provided Java local time. |
default SelfT |
setLong(int i,
long v)
Sets the
i th value to the provided Java primitive long. |
default <KeyT,ValueT> |
setMap(int i,
Map<KeyT,ValueT> v,
Class<KeyT> keyClass,
Class<ValueT> valueClass)
Sets the
i th value to the provided Java map. |
default <ElementT> SelfT |
setSet(int i,
Set<ElementT> v,
Class<ElementT> elementsClass)
Sets the
i th value to the provided Java set. |
default SelfT |
setShort(int i,
short v)
Sets the
i th value to the provided Java primitive short. |
default SelfT |
setString(int i,
String v)
Sets the
i th value to the provided Java string. |
default SelfT |
setToken(int i,
Token v)
Sets the
i th value to the provided token. |
default SelfT |
setToNull(int i)
Sets the
i th value to CQL NULL . |
default SelfT |
setTupleValue(int i,
TupleValue v)
Sets the
i th value to the provided tuple value. |
default SelfT |
setUdtValue(int i,
UdtValue v)
Sets the
i th value to the provided user defined type value. |
default SelfT |
setUuid(int i,
UUID v)
Sets the
i th value to the provided Java UUID. |
getType, size
codecRegistry, protocolVersion
@NonNull @CheckReturnValue SelfT setBytesUnsafe(int i, @Nullable ByteBuffer v)
i
th value.
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.
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.IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setToNull(int i)
i
th value to CQL NULL
.IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default <ValueT> SelfT set(int i, @Nullable ValueT v, @NonNull TypeCodec<ValueT> codec)
i
th value, 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.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default <ValueT> SelfT set(int i, @Nullable ValueT v, @NonNull GenericType<ValueT> targetType)
i
th value, 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 set(int, Object, Class)
instead, which may perform slightly better.
IndexOutOfBoundsException
- if the index is invalid.CodecNotFoundException
- if no codec can perform the conversion.@NonNull @CheckReturnValue default <ValueT> SelfT set(int i, @Nullable ValueT v, @NonNull Class<ValueT> targetClass)
i
th value, 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 set(int, Object, GenericType)
instead.
IndexOutOfBoundsException
- if the index is invalid.CodecNotFoundException
- if no codec can perform the conversion.@NonNull @CheckReturnValue default SelfT setBoolean(int i, boolean v)
i
th value to the provided Java primitive boolean.
By default, this works with CQL type boolean
.
To set the value to CQL NULL
, use setToNull(int)
, or set(i, v,
Boolean.class)
.
IndexOutOfBoundsException
- if the index is invalid.@Deprecated @NonNull @CheckReturnValue default SelfT setBool(int i, boolean v)
setBoolean(int, boolean)
.@NonNull @CheckReturnValue default SelfT setByte(int i, byte v)
i
th value to the provided Java primitive byte.
By default, this works with CQL type tinyint
.
To set the value to CQL NULL
, use setToNull(int)
, or set(i, v,
Boolean.class)
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setDouble(int i, double v)
i
th value to the provided Java primitive double.
By default, this works with CQL type double
.
To set the value to CQL NULL
, use setToNull(int)
, or set(i, v,
Double.class)
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setFloat(int i, float v)
i
th value to the provided Java primitive float.
By default, this works with CQL type float
.
To set the value to CQL NULL
, use setToNull(int)
, or set(i, v,
Float.class)
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setInt(int i, int v)
i
th value to the provided Java primitive integer.
By default, this works with CQL type int
.
To set the value to CQL NULL
, use setToNull(int)
, or set(i, v,
Integer.class)
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setLong(int i, long v)
i
th value to the provided Java primitive long.
By default, this works with CQL types bigint
and counter
.
To set the value to CQL NULL
, use setToNull(int)
, or set(i, v,
Long.class)
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setShort(int i, short v)
i
th value to the provided Java primitive short.
By default, this works with CQL type smallint
.
To set the value to CQL NULL
, use setToNull(int)
, or set(i, v,
Short.class)
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setInstant(int i, @Nullable Instant v)
i
th value to the provided Java instant.
By default, this works with CQL type timestamp
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setLocalDate(int i, @Nullable LocalDate v)
i
th value to the provided Java local date.
By default, this works with CQL type date
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setLocalTime(int i, @Nullable LocalTime v)
i
th value to the provided Java local time.
By default, this works with CQL type time
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setByteBuffer(int i, @Nullable ByteBuffer v)
i
th value to the provided Java byte buffer.
By default, this works with CQL type blob
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setString(int i, @Nullable String v)
i
th value to the provided Java string.
By default, this works with CQL types text
, varchar
and ascii
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setBigInteger(int i, @Nullable BigInteger v)
i
th value to the provided Java big integer.
By default, this works with CQL type varint
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setBigDecimal(int i, @Nullable BigDecimal v)
i
th value to the provided Java big decimal.
By default, this works with CQL type decimal
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setUuid(int i, @Nullable UUID v)
i
th value to the provided Java UUID.
By default, this works with CQL types uuid
and timeuuid
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setInetAddress(int i, @Nullable InetAddress v)
i
th value to the provided Java IP address.
By default, this works with CQL type inet
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setCqlDuration(int i, @Nullable CqlDuration v)
i
th value to the provided duration.
By default, this works with CQL type duration
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setToken(int i, @NonNull Token v)
i
th value 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
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default <ElementT> SelfT setList(int i, @Nullable List<ElementT> v, @NonNull Class<ElementT> elementsClass)
i
th value 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 set(int, Object, GenericType)
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default <ElementT> SelfT setSet(int i, @Nullable Set<ElementT> v, @NonNull Class<ElementT> elementsClass)
i
th value 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 set(int, Object, GenericType)
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default <KeyT,ValueT> SelfT setMap(int i, @Nullable Map<KeyT,ValueT> v, @NonNull Class<KeyT> keyClass, @NonNull Class<ValueT> valueClass)
i
th value 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 set(int, Object, GenericType)
.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setUdtValue(int i, @Nullable UdtValue v)
i
th value to the provided user defined type value.
By default, this works with CQL user-defined types.
IndexOutOfBoundsException
- if the index is invalid.@NonNull @CheckReturnValue default SelfT setTupleValue(int i, @Nullable TupleValue v)
i
th value to the provided tuple value.
By default, this works with CQL tuples.
IndexOutOfBoundsException
- if the index is invalid.Copyright © 2017–2024. All rights reserved.