Class UDTValue
- java.lang.Object
-
- org.apache.cassandra.cql3.functions.types.AbstractGettableData
-
- org.apache.cassandra.cql3.functions.types.UDTValue
-
- All Implemented Interfaces:
GettableByIndexData,GettableByNameData,GettableData,SettableByIndexData<UDTValue>,SettableByNameData<UDTValue>,SettableData<UDTValue>
public class UDTValue extends AbstractGettableData
A value for a User Defined Type.
-
-
Field Summary
Fields Modifier and Type Field Description protected ProtocolVersionprotocolVersion
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> TypeCodec<T>codecFor(int i)protected <T> TypeCodec<T>codecFor(int i, com.google.common.reflect.TypeToken<T> javaType)protected <T> TypeCodec<T>codecFor(int i, java.lang.Class<T> javaClass)protected <T> TypeCodec<T>codecFor(int i, T value)booleanequals(java.lang.Object o)<T> Tget(int i, com.google.common.reflect.TypeToken<T> targetType)Returns theith value converted to the given Java type.<T> Tget(int i, java.lang.Class<T> targetClass)Returns theith value converted to the given Java type.<T> Tget(int i, TypeCodec<T> codec)Returns theith value converted using the givenTypeCodec.protected int[]getAllIndexesOf(java.lang.String name)booleangetBool(int i)Returns theith value as a boolean.bytegetByte(int i)Returns theith value as a byte.java.nio.ByteBuffergetBytes(int i)Returns theith value as a byte array.java.nio.ByteBuffergetBytesUnsafe(int i)Returns theith value as aByteBuffer.protected CodecRegistrygetCodecRegistry()LocalDategetDate(int i)Returns theith value as a date (without time).java.math.BigDecimalgetDecimal(int i)Returns theith value as a variable length decimal.doublegetDouble(int i)Returns theith value as a double.floatgetFloat(int i)Returns theith value as a float.protected intgetIndexOf(java.lang.String name)Returns the index corresponding to a given name.java.net.InetAddressgetInet(int i)Returns theith value as an InetAddress.intgetInt(int i)Returns theith value as an integer.<T> java.util.List<T>getList(int i, com.google.common.reflect.TypeToken<T> elementsType)Returns theith value as a list.<T> java.util.List<T>getList(int i, java.lang.Class<T> elementsClass)Returns theith value as a list.longgetLong(int i)Returns theith value as a long.<K,V>
java.util.Map<K,V>getMap(int i, com.google.common.reflect.TypeToken<K> keysType, com.google.common.reflect.TypeToken<V> valuesType)Returns theith value as a map.<K,V>
java.util.Map<K,V>getMap(int i, java.lang.Class<K> keysClass, java.lang.Class<V> valuesClass)Returns theith value as a map.protected java.lang.StringgetName(int i)Returns the name corresponding to the value at indexi.java.lang.ObjectgetObject(int i)Returns theith value as the Java type matching its CQL type.<T> java.util.Set<T>getSet(int i, com.google.common.reflect.TypeToken<T> elementsType)Returns theith value as a set.<T> java.util.Set<T>getSet(int i, java.lang.Class<T> elementsClass)Returns theith value as a set.shortgetShort(int i)Returns theith value as a short.java.lang.StringgetString(int i)Returns theith value as a string.longgetTime(int i)Returns theith value as a long in nanoseconds since midnight.java.util.DategetTimestamp(int i)Returns theith value as a date.TupleValuegetTupleValue(int i)Return theith value as a tuple value.UserTypegetType()The UDT this is a value of.protected DataTypegetType(int i)Returns the type for the value at indexi.UDTValuegetUDTValue(int i)Return theith value as a UDT value.java.util.UUIDgetUUID(int i)Returns theith value as a UUID.protected java.nio.ByteBuffergetValue(int i)Returns the value at indexi.java.math.BigIntegergetVarint(int i)Returns theith value as a variable length integer.inthashCode()booleanisNull(int i)Returns whether theith value is NULL.<V> Tset(int i, V v, com.google.common.reflect.TypeToken<V> targetType)Sets theith value to the provided value of the provided Java type.<V> Tset(int i, V v, java.lang.Class<V> targetClass)Sets theith value to the provided value of the provided Java class.<V> Tset(int i, V v, TypeCodec<V> codec)Sets theith value to the provided value, converted using the givenTypeCodec.<V> Tset(java.lang.String name, V v, com.google.common.reflect.TypeToken<V> targetType)Sets the value for (all occurrences of) variablenameto the provided value of the provided Java type.<V> Tset(java.lang.String name, V v, java.lang.Class<V> targetClass)Sets the value for (all occurrences of) variablenameto the provided value of the provided Java class.<V> Tset(java.lang.String name, V v, TypeCodec<V> codec)Sets the value for (all occurrences of) variablenameto the provided value, converted using the givenTypeCodec.TsetBool(int i, boolean v)Sets theith value to the provided boolean.TsetBool(java.lang.String name, boolean v)Sets the value for (all occurrences of) variablenameto the provided boolean.TsetByte(int i, byte v)Set theith value to the provided byte.TsetByte(java.lang.String name, byte v)Sets the value for (all occurrences of) variablenameto the provided byte.TsetBytes(int i, java.nio.ByteBuffer v)Sets theith value to the provided byte buffer.TsetBytes(java.lang.String name, java.nio.ByteBuffer v)Sets the value for (all occurrences of) variablenameto the provided byte buffer.TsetBytesUnsafe(int i, java.nio.ByteBuffer v)Sets theith value to the provided byte buffer.TsetBytesUnsafe(java.lang.String name, java.nio.ByteBuffer v)Sets the value for (all occurrences of) variablenameto the provided byte buffer.TsetDate(int i, LocalDate v)Set theith value to the provided date (without time).TsetDate(java.lang.String name, LocalDate v)Sets the value for (all occurrences of) variablenameto the provided date (without time).TsetDecimal(int i, java.math.BigDecimal v)Sets theith value to the provided big decimal.TsetDecimal(java.lang.String name, java.math.BigDecimal v)Sets the value for (all occurrences of) variablenameto the provided big decimal.TsetDouble(int i, double v)Sets theith value to the provided double.TsetDouble(java.lang.String name, double v)Sets the value for (all occurrences of) variablenameto the provided double.TsetFloat(int i, float v)Sets theith value to the provided float.TsetFloat(java.lang.String name, float v)Sets the value for (all occurrences of) variablenameto the provided float.TsetInet(int i, java.net.InetAddress v)Sets theith value to the provided inet address.TsetInet(java.lang.String name, java.net.InetAddress v)Sets the value for (all occurrences of) variablenameto the provided inet address.TsetInt(int i, int v)Set theith value to the provided integer.TsetInt(java.lang.String name, int v)Sets the value for (all occurrences of) variablenameto the provided integer.<E> TsetList(int i, java.util.List<E> v)Sets theith value to the provided list.<E> TsetList(int i, java.util.List<E> v, com.google.common.reflect.TypeToken<E> elementsType)Sets theith value to the provided list, which elements are of the provided Java type.<E> TsetList(int i, java.util.List<E> v, java.lang.Class<E> elementsClass)Sets theith value to the provided list, which elements are of the provided Java class.<E> TsetList(java.lang.String name, java.util.List<E> v)Sets the value for (all occurrences of) variablenameto the provided list.<E> TsetList(java.lang.String name, java.util.List<E> v, com.google.common.reflect.TypeToken<E> elementsType)Sets the value for (all occurrences of) variablenameto the provided list, which elements are of the provided Java type.<E> TsetList(java.lang.String name, java.util.List<E> v, java.lang.Class<E> elementsClass)Sets the value for (all occurrences of) variablenameto the provided list, which elements are of the provided Java class.TsetLong(int i, long v)Sets theith value to the provided long.TsetLong(java.lang.String name, long v)Sets the value for (all occurrences of) variablenameto the provided long.<K,V>
TsetMap(int i, java.util.Map<K,V> v)Sets theith value to the provided map.<K,V>
TsetMap(int i, java.util.Map<K,V> v, com.google.common.reflect.TypeToken<K> keysType, com.google.common.reflect.TypeToken<V> valuesType)Sets theith value to the provided map, which keys and values are of the provided Java types.<K,V>
TsetMap(int i, java.util.Map<K,V> v, java.lang.Class<K> keysClass, java.lang.Class<V> valuesClass)Sets theith value to the provided map, which keys and values are of the provided Java classes.<K,V>
TsetMap(java.lang.String name, java.util.Map<K,V> v)Sets the value for (all occurrences of) variablenameto the provided map.<K,V>
TsetMap(java.lang.String name, java.util.Map<K,V> v, com.google.common.reflect.TypeToken<K> keysType, com.google.common.reflect.TypeToken<V> valuesType)Sets the value for (all occurrences of) variablenameto the provided map, which keys and values are of the provided Java types.<K,V>
TsetMap(java.lang.String name, java.util.Map<K,V> v, java.lang.Class<K> keysClass, java.lang.Class<V> valuesClass)Sets the value for (all occurrences of) variablenameto the provided map, which keys and values are of the provided Java classes.<E> TsetSet(int i, java.util.Set<E> v)Sets theith value to the provided set.<E> TsetSet(int i, java.util.Set<E> v, com.google.common.reflect.TypeToken<E> elementsType)Sets theith value to the provided set, which elements are of the provided Java type.<E> TsetSet(int i, java.util.Set<E> v, java.lang.Class<E> elementsClass)Sets theith value to the provided set, which elements are of the provided Java class.<E> TsetSet(java.lang.String name, java.util.Set<E> v)Sets the value for (all occurrences of) variablenameto the provided set.<E> TsetSet(java.lang.String name, java.util.Set<E> v, com.google.common.reflect.TypeToken<E> elementsType)Sets the value for (all occurrences of) variablenameto the provided set, which elements are of the provided Java type.<E> TsetSet(java.lang.String name, java.util.Set<E> v, java.lang.Class<E> elementsClass)Sets the value for (all occurrences of) variablenameto the provided set, which elements are of the provided Java class.TsetShort(int i, short v)Set theith value to the provided short.TsetShort(java.lang.String name, short v)Sets the value for (all occurrences of) variablenameto the provided short.TsetString(int i, java.lang.String v)Sets theith value to the provided string.TsetString(java.lang.String name, java.lang.String v)Sets the value for (all occurrences of) variablenameto the provided string.TsetTime(int i, long v)Set theith value to the provided time as a long in nanoseconds since midnight.TsetTime(java.lang.String name, long v)Sets the value for (all occurrences of) variablenameto the provided time as a long in nanoseconds since midnight.TsetTimestamp(int i, java.util.Date v)Set theith value to the provided date.TsetTimestamp(java.lang.String name, java.util.Date v)Sets the value for (all occurrences of) variablenameto the provided date.TsetToNull(int i)Sets theith value tonull.TsetToNull(java.lang.String name)Sets the value for (all occurrences of) variablenametonull.TsetTupleValue(int i, TupleValue v)Sets theith value to the provided tuple value.TsetTupleValue(java.lang.String name, TupleValue v)Sets the value for (all occurrences of) variablenameto the provided tuple value.TsetUDTValue(int i, UDTValue v)Sets theith value to the provided UDT value.TsetUDTValue(java.lang.String name, UDTValue v)Sets the value for (all occurrences of) variablenameto the provided UDT value.TsetUUID(int i, java.util.UUID v)Sets theith value to the provided UUID.TsetUUID(java.lang.String name, java.util.UUID v)Sets the value for (all occurrences of) variablenameto the provided UUID.TsetVarint(int i, java.math.BigInteger v)Sets theith value to the provided big integer.TsetVarint(java.lang.String name, java.math.BigInteger v)Sets the value for (all occurrences of) variablenameto the provided big integer.java.lang.StringtoString()-
Methods inherited from class org.apache.cassandra.cql3.functions.types.AbstractGettableData
get, get, get, getBool, getByte, getBytes, getBytesUnsafe, getDate, getDecimal, getDouble, getFloat, getInet, getInt, getList, getList, getLong, getMap, getMap, getObject, getSet, getSet, getShort, getString, getTime, getTimestamp, getTupleValue, getUDTValue, getUUID, getVarint, isNull
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.functions.types.GettableByIndexData
get, get, get, getBool, getByte, getBytes, getBytesUnsafe, getDate, getDecimal, getDouble, getFloat, getInet, getInt, getList, getList, getLong, getMap, getMap, getObject, getSet, getSet, getShort, getString, getTime, getTimestamp, getTupleValue, getUDTValue, getUUID, getVarint, isNull
-
-
-
-
Field Detail
-
protocolVersion
protected final ProtocolVersion protocolVersion
-
-
Method Detail
-
getType
protected DataType getType(int i)
Returns the type for the value at indexi.- Parameters:
i- the index of the type to fetch.- Returns:
- the type of the value at index
i.
-
getName
protected java.lang.String getName(int i)
Returns the name corresponding to the value at indexi.- Parameters:
i- the index of the name to fetch.- Returns:
- the name corresponding to the value at index
i.
-
getCodecRegistry
protected CodecRegistry getCodecRegistry()
-
getAllIndexesOf
protected int[] getAllIndexesOf(java.lang.String name)
-
getType
public UserType getType()
The UDT this is a value of.- Returns:
- the UDT this is a value of.
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getValue
protected java.nio.ByteBuffer getValue(int i)
Returns the value at indexi.- Parameters:
i- the index to fetch.- Returns:
- the value at index
i.
-
getIndexOf
protected int getIndexOf(java.lang.String name)
Description copied from class:AbstractGettableDataReturns the index corresponding to a given name.- Specified by:
getIndexOfin classAbstractGettableData- Parameters:
name- the name for which to return the index of.- Returns:
- the index for the value coressponding to
name.
-
setBool
public T setBool(int i, boolean v)Description copied from interface:SettableByIndexDataSets theith value to the provided boolean.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typeboolean, this will be the built-in codec).- Specified by:
setBoolin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. To set the value to NULL, useSettableByIndexData.setToNull(int)orset(i, v, Boolean.class)- Returns:
- this object.
-
setBool
public T setBool(java.lang.String name, boolean v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided boolean.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typeboolean, this will be the built-in codec).- Specified by:
setBoolin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. To set the value to NULL, useSettableByNameData.setToNull(String)orset(name, v, Boolean.class).- Returns:
- this object.
-
setByte
public T setByte(int i, byte v)Description copied from interface:SettableByIndexDataSet theith value to the provided byte.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typetinyint, this will be the built-in codec).- Specified by:
setBytein interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. To set the value to NULL, useSettableByIndexData.setToNull(int)orset(i, v, Byte.class)- Returns:
- this object.
-
setByte
public T setByte(java.lang.String name, byte v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided byte.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typetinyint, this will be the built-in codec).- Specified by:
setBytein interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. To set the value to NULL, useSettableByNameData.setToNull(String)orset(name, v, Byte.class).- Returns:
- this object.
-
setShort
public T setShort(int i, short v)Description copied from interface:SettableByIndexDataSet theith value to the provided short.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typesmallint, this will be the built-in codec).- Specified by:
setShortin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. To set the value to NULL, useSettableByIndexData.setToNull(int)orset(i, v, Short.class)- Returns:
- this object.
-
setShort
public T setShort(java.lang.String name, short v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided short.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typesmallint, this will be the built-in codec).- Specified by:
setShortin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. To set the value to NULL, useSettableByNameData.setToNull(String)orset(name, v, Short.class).- Returns:
- this object.
-
setInt
public T setInt(int i, int v)Description copied from interface:SettableByIndexDataSet theith value to the provided integer.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typeint, this will be the built-in codec).- Specified by:
setIntin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. To set the value to NULL, useSettableByIndexData.setToNull(int)orset(i, v, Integer.class)- Returns:
- this object.
-
setInt
public T setInt(java.lang.String name, int v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided integer.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typeint, this will be the built-in codec).- Specified by:
setIntin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. To set the value to NULL, useSettableByNameData.setToNull(String)orset(name, v, Integer.class).- Returns:
- this object.
-
setLong
public T setLong(int i, long v)Description copied from interface:SettableByIndexDataSets theith value to the provided long.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typebigint, this will be the built-in codec).- Specified by:
setLongin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. To set the value to NULL, useSettableByIndexData.setToNull(int)orset(i, v, Long.class)- Returns:
- this object.
-
setLong
public T setLong(java.lang.String name, long v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided long.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typebigint, this will be the built-in codec).- Specified by:
setLongin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. To set the value to NULL, useSettableByNameData.setToNull(String)orset(name, v, Long.class).- Returns:
- this object.
-
setTimestamp
public T setTimestamp(int i, java.util.Date v)Description copied from interface:SettableByIndexDataSet theith value to the provided date.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typetimestamp, this will be the built-in codec).- Specified by:
setTimestampin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setTimestamp
public T setTimestamp(java.lang.String name, java.util.Date v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided date.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typetimestamp, this will be the built-in codec).- Specified by:
setTimestampin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setDate
public T setDate(int i, LocalDate v)Description copied from interface:SettableByIndexDataSet theith value to the provided date (without time).This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typedate, this will be the built-in codec).- Specified by:
setDatein interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setDate
public T setDate(java.lang.String name, LocalDate v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided date (without time).This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typedate, this will be the built-in codec).- Specified by:
setDatein interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setTime
public T setTime(int i, long v)Description copied from interface:SettableByIndexDataSet theith value to the provided time as a long in nanoseconds since midnight.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typetime, this will be the built-in codec).- Specified by:
setTimein interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setTime
public T setTime(java.lang.String name, long v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided time as a long in nanoseconds since midnight.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typetime, this will be the built-in codec).- Specified by:
setTimein interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setFloat
public T setFloat(int i, float v)Description copied from interface:SettableByIndexDataSets theith value to the provided float.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typefloat, this will be the built-in codec).- Specified by:
setFloatin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. To set the value to NULL, useSettableByIndexData.setToNull(int)orset(i, v, Float.class)- Returns:
- this object.
-
setFloat
public T setFloat(java.lang.String name, float v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided float.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typefloat, this will be the built-in codec).- Specified by:
setFloatin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. To set the value to NULL, useSettableByNameData.setToNull(String)orset(name, v, Float.class).- Returns:
- this object.
-
setDouble
public T setDouble(int i, double v)Description copied from interface:SettableByIndexDataSets theith value to the provided double.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typedouble, this will be the built-in codec).- Specified by:
setDoublein interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. To set the value to NULL, useSettableByIndexData.setToNull(int)orset(i, v, Double.class).- Returns:
- this object.
-
setDouble
public T setDouble(java.lang.String name, double v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided double.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typedouble, this will be the built-in codec).- Specified by:
setDoublein interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. To set the value to NULL, useSettableByNameData.setToNull(String)orset(name, v, Double.class).- Returns:
- this object.
-
setString
public T setString(int i, java.lang.String v)Description copied from interface:SettableByIndexDataSets theith value to the provided string.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typestext,varcharandascii, this will be the built-in codec).- Specified by:
setStringin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setString
public T setString(java.lang.String name, java.lang.String v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided string.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typestext,varcharandascii, this will be the built-in codec).- Specified by:
setStringin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setBytes
public T setBytes(int i, java.nio.ByteBuffer v)Description copied from interface:SettableByIndexDataSets theith value to the provided byte buffer.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typeblob, this will be the built-in codec).- Specified by:
setBytesin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setBytes
public T setBytes(java.lang.String name, java.nio.ByteBuffer v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided byte buffer.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typeblob, this will be the built-in codec).- Specified by:
setBytesin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setBytesUnsafe
public T setBytesUnsafe(int i, java.nio.ByteBuffer v)Description copied from interface:SettableByIndexDataSets theith value to the provided byte buffer.This method does not use any codec; it sets the value in its binary form directly. If you insert data that is not compatible with the underlying CQL type, you will get an
InvalidQueryExceptionat execute time.- Specified by:
setBytesUnsafein interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setBytesUnsafe
public T setBytesUnsafe(java.lang.String name, java.nio.ByteBuffer v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided byte buffer.This method does not use any codec; it sets the value in its binary form directly. If you insert data that is not compatible with the underlying CQL type, you will get an
InvalidQueryExceptionat execute time.- Specified by:
setBytesUnsafein interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setVarint
public T setVarint(int i, java.math.BigInteger v)Description copied from interface:SettableByIndexDataSets theith value to the provided big integer.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typevarint, this will be the built-in codec).- Specified by:
setVarintin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setVarint
public T setVarint(java.lang.String name, java.math.BigInteger v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided big integer.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typevarint, this will be the built-in codec).- Specified by:
setVarintin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setDecimal
public T setDecimal(int i, java.math.BigDecimal v)Description copied from interface:SettableByIndexDataSets theith value to the provided big decimal.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typedecimal, this will be the built-in codec).- Specified by:
setDecimalin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setDecimal
public T setDecimal(java.lang.String name, java.math.BigDecimal v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided big decimal.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typedecimal, this will be the built-in codec).- Specified by:
setDecimalin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setUUID
public T setUUID(int i, java.util.UUID v)Description copied from interface:SettableByIndexDataSets theith value to the provided UUID.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typesuuidandtimeuuid, this will be the built-in codec).- Specified by:
setUUIDin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setUUID
public T setUUID(java.lang.String name, java.util.UUID v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided UUID.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typesuuidandtimeuuid, this will be the built-in codec).- Specified by:
setUUIDin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setInet
public T setInet(int i, java.net.InetAddress v)Description copied from interface:SettableByIndexDataSets theith value to the provided inet address.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typeinet, this will be the built-in codec).- Specified by:
setInetin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setInet
public T setInet(java.lang.String name, java.net.InetAddress v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided inet address.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (for CQL typeinet, this will be the built-in codec).- Specified by:
setInetin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setList
public <E> T setList(int i, java.util.List<E> v)Description copied from interface:SettableByIndexDataSets theith value to the provided list.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (the type of the elements in the Java list is not considered). If two or more codecs target that CQL type, the one that was first registered will be used. For this reason, it is generally preferable to use the more deterministic methodsSettableByIndexData.setList(int, List, Class)orSettableByIndexData.setList(int, List, TypeToken).- Specified by:
setListin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.- Returns:
- this object.
-
setList
public <E> T setList(int i, java.util.List<E> v, java.lang.Class<E> elementsClass)Description copied from interface:SettableByIndexDataSets theith value to the provided list, which elements are of the provided Java class.This method uses the
CodecRegistryto find a codec to handle the conversion of lists of the given Java type to the underlying CQL type.If the type of the elements is generic, use
SettableByIndexData.setList(int, List, TypeToken).- Specified by:
setListin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.elementsClass- the class for the elements of the list.- Returns:
- this object.
-
setList
public <E> T setList(int i, java.util.List<E> v, com.google.common.reflect.TypeToken<E> elementsType)Description copied from interface:SettableByIndexDataSets theith value to the provided list, which elements are of the provided Java type.This method uses the
CodecRegistryto find a codec to handle the conversion of lists of the given Java type to the underlying CQL type.- Specified by:
setListin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.elementsType- the type for the elements of the list.- Returns:
- this object.
-
setList
public <E> T setList(java.lang.String name, java.util.List<E> v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided list.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (the type of the elements in the Java list is not considered). If two or more codecs target that CQL type, the one that was first registered will be used. For this reason, it is generally preferable to use the more deterministic methodsSettableByNameData.setList(String, List, Class)orSettableByNameData.setList(String, List, TypeToken).- Specified by:
setListin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.- Returns:
- this object.
-
setList
public <E> T setList(java.lang.String name, java.util.List<E> v, java.lang.Class<E> elementsClass)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided list, which elements are of the provided Java class.This method uses the
CodecRegistryto find a codec to handle the conversion of lists of the given Java type to the underlying CQL type.If the type of the elements is generic, use
SettableByNameData.setList(String, List, TypeToken).- Specified by:
setListin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiplev- the value to set. Note thatnullvalues inside collections are not supported by CQL.elementsClass- the class for the elements of the list.- Returns:
- this object.
-
setList
public <E> T setList(java.lang.String name, java.util.List<E> v, com.google.common.reflect.TypeToken<E> elementsType)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided list, which elements are of the provided Java type.This method uses the
CodecRegistryto find a codec to handle the conversion of lists of the given Java type to the underlying CQL type.- Specified by:
setListin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiplev- the value to set. Note thatnullvalues inside collections are not supported by CQL.elementsType- the type for the elements of the list.- Returns:
- this object.
-
setMap
public <K,V> T setMap(int i, java.util.Map<K,V> v)Description copied from interface:SettableByIndexDataSets theith value to the provided map.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (the type of the elements in the Java map is not considered). If two or more codecs target that CQL type, the one that was first registered will be used. For this reason, it is generally preferable to use the more deterministic methodsSettableByIndexData.setMap(int, Map, Class, Class)orSettableByIndexData.setMap(int, Map, TypeToken, TypeToken).- Specified by:
setMapin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.- Returns:
- this object.
-
setMap
public <K,V> T setMap(int i, java.util.Map<K,V> v, java.lang.Class<K> keysClass, java.lang.Class<V> valuesClass)Description copied from interface:SettableByIndexDataSets theith value to the provided map, which keys and values are of the provided Java classes.This method uses the
CodecRegistryto find a codec to handle the conversion of lists of the given Java types to the underlying CQL type.If the type of the keys or values is generic, use
SettableByIndexData.setMap(int, Map, TypeToken, TypeToken).- Specified by:
setMapin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.keysClass- the class for the keys of the map.valuesClass- the class for the values of the map.- Returns:
- this object.
-
setMap
public <K,V> T setMap(int i, java.util.Map<K,V> v, com.google.common.reflect.TypeToken<K> keysType, com.google.common.reflect.TypeToken<V> valuesType)Description copied from interface:SettableByIndexDataSets theith value to the provided map, which keys and values are of the provided Java types.This method uses the
CodecRegistryto find a codec to handle the conversion of lists of the given Java types to the underlying CQL type.- Specified by:
setMapin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.keysType- the type for the keys of the map.valuesType- the type for the values of the map.- Returns:
- this object.
-
setMap
public <K,V> T setMap(java.lang.String name, java.util.Map<K,V> v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided map.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (the type of the elements in the Java map is not considered). If two or more codecs target that CQL type, the one that was first registered will be used. For this reason, it is generally preferable to use the more deterministic methodsSettableByNameData.setMap(String, Map, Class, Class)orSettableByNameData.setMap(String, Map, TypeToken, TypeToken).- Specified by:
setMapin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.- Returns:
- this object.
-
setMap
public <K,V> T setMap(java.lang.String name, java.util.Map<K,V> v, java.lang.Class<K> keysClass, java.lang.Class<V> valuesClass)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided map, which keys and values are of the provided Java classes.This method uses the
CodecRegistryto find a codec to handle the conversion of lists of the given Java types to the underlying CQL type.If the type of the keys or values is generic, use
SettableByNameData.setMap(String, Map, TypeToken, TypeToken).- Specified by:
setMapin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.keysClass- the class for the keys of the map.valuesClass- the class for the values of the map.- Returns:
- this object.
-
setMap
public <K,V> T setMap(java.lang.String name, java.util.Map<K,V> v, com.google.common.reflect.TypeToken<K> keysType, com.google.common.reflect.TypeToken<V> valuesType)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided map, which keys and values are of the provided Java types.This method uses the
CodecRegistryto find a codec to handle the conversion of lists of the given Java types to the underlying CQL type.- Specified by:
setMapin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.keysType- the type for the keys of the map.valuesType- the type for the values of the map.- Returns:
- this object.
-
setSet
public <E> T setSet(int i, java.util.Set<E> v)Description copied from interface:SettableByIndexDataSets theith value to the provided set.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (the type of the elements in the Java set is not considered). If two or more codecs target that CQL type, the one that was first registered will be used. For this reason, it is generally preferable to use the more deterministic methodsSettableByIndexData.setSet(int, Set, Class)orSettableByIndexData.setSet(int, Set, TypeToken).- Specified by:
setSetin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.- Returns:
- this object.
-
setSet
public <E> T setSet(int i, java.util.Set<E> v, java.lang.Class<E> elementsClass)Description copied from interface:SettableByIndexDataSets theith value to the provided set, which elements are of the provided Java class.This method uses the
CodecRegistryto find a codec to handle the conversion of sets of the given Java type to the underlying CQL type.If the type of the elements is generic, use
SettableByIndexData.setSet(int, Set, TypeToken).- Specified by:
setSetin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.elementsClass- the class for the elements of the set.- Returns:
- this object.
-
setSet
public <E> T setSet(int i, java.util.Set<E> v, com.google.common.reflect.TypeToken<E> elementsType)Description copied from interface:SettableByIndexDataSets theith value to the provided set, which elements are of the provided Java type.This method uses the
CodecRegistryto find a codec to handle the conversion of sets of the given Java type to the underlying CQL type.- Specified by:
setSetin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.elementsType- the type for the elements of the set.- Returns:
- this object.
-
setSet
public <E> T setSet(java.lang.String name, java.util.Set<E> v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided set.This method uses the
CodecRegistryto find a codec to handle the conversion to the underlying CQL type (the type of the elements in the Java set is not considered). If two or more codecs target that CQL type, the one that was first registered will be used. For this reason, it is generally preferable to use the more deterministic methodsSettableByNameData.setSet(String, Set, Class)orSettableByNameData.setSet(String, Set, TypeToken).- Specified by:
setSetin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set. Note thatnullvalues inside collections are not supported by CQL.- Returns:
- this object.
-
setSet
public <E> T setSet(java.lang.String name, java.util.Set<E> v, java.lang.Class<E> elementsClass)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided set, which elements are of the provided Java class.This method uses the
CodecRegistryto find a codec to handle the conversion of sets of the given Java type to the underlying CQL type.If the type of the elements is generic, use
SettableByNameData.setSet(String, Set, TypeToken).- Specified by:
setSetin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiplev- the value to set. Note thatnullvalues inside collections are not supported by CQL.elementsClass- the class for the elements of the set.- Returns:
- this object.
-
setSet
public <E> T setSet(java.lang.String name, java.util.Set<E> v, com.google.common.reflect.TypeToken<E> elementsType)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided set, which elements are of the provided Java type.This method uses the
CodecRegistryto find a codec to handle the conversion of sets of the given Java type to the underlying CQL type.- Specified by:
setSetin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiplev- the value to set. Note thatnullvalues inside collections are not supported by CQL.elementsType- the type for the elements of the set.- Returns:
- this object.
-
setUDTValue
public T setUDTValue(int i, UDTValue v)Description copied from interface:SettableByIndexDataSets theith value to the provided UDT value.This method uses the
CodecRegistryto find a codec to handle the conversion ofUDTValueto the underlying CQL type.- Specified by:
setUDTValuein interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setUDTValue
public T setUDTValue(java.lang.String name, UDTValue v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided UDT value.This method uses the
CodecRegistryto find a codec to handle the conversion ofUDTValueto the underlying CQL type.- Specified by:
setUDTValuein interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
setTupleValue
public T setTupleValue(int i, TupleValue v)Description copied from interface:SettableByIndexDataSets theith value to the provided tuple value.This method uses the
CodecRegistryto find a codec to handle the conversion ofTupleValueto the underlying CQL type.- Specified by:
setTupleValuein interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set.- Returns:
- this object.
-
setTupleValue
public T setTupleValue(java.lang.String name, TupleValue v)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided tuple value.This method uses the
CodecRegistryto find a codec to handle the conversion ofTupleValueto the underlying CQL type.- Specified by:
setTupleValuein interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set.- Returns:
- this object.
-
set
public <V> T set(int i, V v, java.lang.Class<V> targetClass)Description copied from interface:SettableByIndexDataSets theith value to the provided value of the provided Java class.This method uses the
CodecRegistryto find a codec to handle the conversion of the provided Java class to the underlying CQL type.If the Java type is generic, use
SettableByIndexData.set(int, Object, TypeToken)instead.- Specified by:
setin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set; may benull.targetClass- The Java class to convert to; must not benull;- Returns:
- this object.
-
set
public <V> T set(java.lang.String name, V v, java.lang.Class<V> targetClass)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided value of the provided Java class.This method uses the
CodecRegistryto find a codec to handle the conversion of the provided Java class to the underlying CQL type.If the Java type is generic, use
SettableByNameData.set(String, Object, TypeToken)instead.- Specified by:
setin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set; may benull.targetClass- The Java class to convert to; must not benull;- Returns:
- this object.
-
set
public <V> T set(int i, V v, com.google.common.reflect.TypeToken<V> targetType)Description copied from interface:SettableByIndexDataSets theith value to the provided value of the provided Java type.This method uses the
CodecRegistryto find a codec to handle the conversion of the provided Java type to the underlying CQL type.- Specified by:
setin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set; may benull.targetType- The Java type to convert to; must not benull;- Returns:
- this object.
-
set
public <V> T set(java.lang.String name, V v, com.google.common.reflect.TypeToken<V> targetType)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided value of the provided Java type.This method uses the
CodecRegistryto find a codec to handle the conversion of the provided Java type to the underlying CQL type.- Specified by:
setin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set; may benull.targetType- The Java type to convert to; must not benull;- Returns:
- this object.
-
set
public <V> T set(int i, V v, TypeCodec<V> codec)Description copied from interface:SettableByIndexDataSets theith value to the provided value, converted using the givenTypeCodec.This method entirely bypasses the
CodecRegistryand 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
acceptsthe underlying CQL type; failing to do so may result inInvalidTypeExceptions being thrown.- Specified by:
setin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.v- the value to set; may benull.codec- TheTypeCodecto use to serialize the value; may not benull.- Returns:
- this object.
-
set
public <V> T set(java.lang.String name, V v, TypeCodec<V> codec)Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenameto the provided value, converted using the givenTypeCodec.This method entirely bypasses the
CodecRegistryand 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
acceptsthe underlying CQL type; failing to do so may result inInvalidTypeExceptions being thrown.- Specified by:
setin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.v- the value to set; may benull.codec- TheTypeCodecto use to serialize the value; may not benull.- Returns:
- this object.
-
setToNull
public T setToNull(int i)
Description copied from interface:SettableByIndexDataSets theith value tonull.This is mainly intended for CQL types which map to native Java types.
- Specified by:
setToNullin interfaceSettableByIndexData<T extends SettableData<T>>- Parameters:
i- the index of the value to set.- Returns:
- this object.
-
setToNull
public T setToNull(java.lang.String name)
Description copied from interface:SettableByNameDataSets the value for (all occurrences of) variablenametonull.This is mainly intended for CQL types which map to native Java types.
- Specified by:
setToNullin interfaceSettableByNameData<T extends SettableData<T>>- Parameters:
name- the name of the value to set; ifnameis present multiple times, all its values are set.- Returns:
- this object.
-
codecFor
protected <T> TypeCodec<T> codecFor(int i)
-
codecFor
protected <T> TypeCodec<T> codecFor(int i, java.lang.Class<T> javaClass)
-
codecFor
protected <T> TypeCodec<T> codecFor(int i, com.google.common.reflect.TypeToken<T> javaType)
-
codecFor
protected <T> TypeCodec<T> codecFor(int i, T value)
-
isNull
public boolean isNull(int i)
Returns whether theith value is NULL.- Specified by:
isNullin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) of the value to check.- Returns:
- whether the
ith value is NULL.
-
getBool
public boolean getBool(int i)
Returns theith value as a boolean.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a Javaboolean(for CQL typeboolean, this will be the built-in codec).- Specified by:
getBoolin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the boolean value of the
ith element. If the value is NULL,falseis returned. If you need to distinguish NULL and false values, check first withGettableByIndexData.isNull(int)or useget(i, Boolean.class).
-
getByte
public byte getByte(int i)
Returns theith value as a byte.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a Javabyte(for CQL typetinyint, this will be the built-in codec).- Specified by:
getBytein interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a byte. If the value is NULL,0is returned. If you need to distinguish NULL and 0, check first withGettableByIndexData.isNull(int)or useget(i, Byte.class).
-
getShort
public short getShort(int i)
Returns theith value as a short.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a Javashort(for CQL typesmallint, this will be the built-in codec).- Specified by:
getShortin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a short. If the value is NULL,0is returned. If you need to distinguish NULL and 0, check first withGettableByIndexData.isNull(int)or useget(i, Short.class).
-
getInt
public int getInt(int i)
Returns theith value as an integer.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a Javaint(for CQL typeint, this will be the built-in codec).- Specified by:
getIntin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as an integer. If the value is NULL,0is returned. If you need to distinguish NULL and 0, check first withGettableByIndexData.isNull(int)or useget(i, Integer.class).
-
getLong
public long getLong(int i)
Returns theith value as a long.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a Javabyte(for CQL typesbigintandcounter, this will be the built-in codec).- Specified by:
getLongin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a long. If the value is NULL,0Lis returned. If you need to distinguish NULL and 0L, check first withGettableByIndexData.isNull(int)or useget(i, Long.class).
-
getTimestamp
public java.util.Date getTimestamp(int i)
Returns theith value as a date.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to aDate(for CQL typetimestamp, this will be the built-in codec).- Specified by:
getTimestampin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a data. If the value is NULL,nullis returned.
-
getDate
public LocalDate getDate(int i)
Returns theith value as a date (without time).This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to aLocalDate(for CQL typedate, this will be the built-in codec).- Specified by:
getDatein interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as an date. If the value is NULL,nullis returned.
-
getTime
public long getTime(int i)
Returns theith value as a long in nanoseconds since midnight.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a Javalong(for CQL typetime, this will be the built-in codec).- Specified by:
getTimein interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a long. If the value is NULL,0Lis returned.
-
getFloat
public float getFloat(int i)
Returns theith value as a float.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a Javafloat(for CQL typefloat, this will be the built-in codec).- Specified by:
getFloatin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a float. If the value is NULL,0.0fis returned. If you need to distinguish NULL and 0.0f, check first withGettableByIndexData.isNull(int)or useget(i, Float.class).
-
getDouble
public double getDouble(int i)
Returns theith value as a double.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a Javadouble(for CQL typedouble, this will be the built-in codec).- Specified by:
getDoublein interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a double. If the value is NULL,0.0is returned. If you need to distinguish NULL and 0.0, check first withGettableByIndexData.isNull(int)or useget(i, Double.class).
-
getBytesUnsafe
public java.nio.ByteBuffer getBytesUnsafe(int i)
Returns theith value as aByteBuffer.This method does not use any codec; it returns a copy of the binary representation of the value. It is up to the caller to convert the returned value appropriately.
- Specified by:
getBytesUnsafein interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a ByteBuffer. If the value is NULL,nullis returned.
-
getBytes
public java.nio.ByteBuffer getBytes(int i)
Returns theith value as a byte array.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a JavaByteBuffer(for CQL typeblob, this will be the built-in codec).- Specified by:
getBytesin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a byte array. If the value is NULL,nullis returned.
-
getString
public java.lang.String getString(int i)
Returns theith value as a string.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a Java string (for CQL typestext,varcharandascii, this will be the built-in codec).- Specified by:
getStringin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a string. If the value is NULL,nullis returned.
-
getVarint
public java.math.BigInteger getVarint(int i)
Returns theith value as a variable length integer.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to aBigInteger(for CQL typevarint, this will be the built-in codec).- Specified by:
getVarintin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a variable length integer. If the value is NULL,nullis returned.
-
getDecimal
public java.math.BigDecimal getDecimal(int i)
Returns theith value as a variable length decimal.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to aBigDecimal(for CQL typedecimal, this will be the built-in codec).- Specified by:
getDecimalin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a variable length decimal. If the value is NULL,nullis returned.
-
getUUID
public java.util.UUID getUUID(int i)
Returns theith value as a UUID.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to aUUID(for CQL typesuuidandtimeuuid, this will be the built-in codec).- Specified by:
getUUIDin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a UUID. If the value is NULL,nullis returned.
-
getInet
public java.net.InetAddress getInet(int i)
Returns theith value as an InetAddress.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to anInetAddress(for CQL typeinet, this will be the built-in codec).- Specified by:
getInetin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as an InetAddress. If the value is NULL,nullis returned.
-
getList
public <T> java.util.List<T> getList(int i, java.lang.Class<T> elementsClass)Returns theith value as a list.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a list of the specified type.If the type of the elements is generic, use
GettableByIndexData.getList(int, TypeToken).Implementation note: the actual
Listimplementation will depend on thecodecbeing used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQLNULLvalues is also codec-dependent. By default, the driver will return mutable instances, and a CQLNULLwill be mapped to an empty collection (note that Cassandra makes no distinction betweenNULLand an empty collection).- Specified by:
getListin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.elementsClass- the class for the elements of the list to retrieve.- Returns:
- the value of the
ith element as a list ofTobjects.
-
getList
public <T> java.util.List<T> getList(int i, com.google.common.reflect.TypeToken<T> elementsType)Returns theith value as a list.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a list of the specified type.Use this variant with nested collections, which produce a generic element type:
List<List<String>> l = row.getList(1, new TypeToken<List<String>>() {});Implementation note: the actual
Listimplementation will depend on thecodecbeing used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQLNULLvalues is also codec-dependent. By default, the driver will return mutable instances, and a CQLNULLwill mapped to an empty collection (note that Cassandra makes no distinction betweenNULLand an empty collection).- Specified by:
getListin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.elementsType- the type of the elements of the list to retrieve.- Returns:
- the value of the
ith element as a list ofTobjects.
-
getSet
public <T> java.util.Set<T> getSet(int i, java.lang.Class<T> elementsClass)Returns theith value as a set.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a set of the specified type.If the type of the elements is generic, use
GettableByIndexData.getSet(int, TypeToken).Implementation note: the actual
Setimplementation will depend on thecodecbeing used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQLNULLvalues is also codec-dependent. By default, the driver will return mutable instances, and a CQLNULLwill mapped to an empty collection (note that Cassandra makes no distinction betweenNULLand an empty collection).- Specified by:
getSetin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.elementsClass- the class for the elements of the set to retrieve.- Returns:
- the value of the
ith element as a set ofTobjects.
-
getSet
public <T> java.util.Set<T> getSet(int i, com.google.common.reflect.TypeToken<T> elementsType)Returns theith value as a set.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a set of the specified type.Use this variant with nested collections, which produce a generic element type:
Set<List<String>> l = row.getSet(1, new TypeToken<List<String>>() {});Implementation note: the actual
Setimplementation will depend on thecodecbeing used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQLNULLvalues is also codec-dependent. By default, the driver will return mutable instances, and a CQLNULLwill mapped to an empty collection (note that Cassandra makes no distinction betweenNULLand an empty collection).- Specified by:
getSetin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.elementsType- the type for the elements of the set to retrieve.- Returns:
- the value of the
ith element as a set ofTobjects.
-
getMap
public <K,V> java.util.Map<K,V> getMap(int i, java.lang.Class<K> keysClass, java.lang.Class<V> valuesClass)Returns theith value as a map.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a map of the specified types.If the type of the keys and/or values is generic, use
GettableByIndexData.getMap(int, TypeToken, TypeToken).Implementation note: the actual
Mapimplementation will depend on thecodecbeing used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQLNULLvalues is also codec-dependent. By default, the driver will return mutable instances, and a CQLNULLwill mapped to an empty collection (note that Cassandra makes no distinction betweenNULLand an empty collection).- Specified by:
getMapin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.keysClass- the class for the keys of the map to retrieve.valuesClass- the class for the values of the map to retrieve.- Returns:
- the value of the
ith element as a map ofKtoVobjects.
-
getMap
public <K,V> java.util.Map<K,V> getMap(int i, com.google.common.reflect.TypeToken<K> keysType, com.google.common.reflect.TypeToken<V> valuesType)Returns theith value as a map.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to a map of the specified types.Use this variant with nested collections, which produce a generic element type:
Map<Int, List<String>> l = row.getMap(1, TypeToken.of(Integer.class), new TypeToken<List<String>>() {});Implementation note: the actual
Mapimplementation will depend on thecodecbeing used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQLNULLvalues is also codec-dependent. By default, the driver will return mutable instances, and a CQLNULLwill mapped to an empty collection (note that Cassandra makes no distinction betweenNULLand an empty collection).- Specified by:
getMapin interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.keysType- the type for the keys of the map to retrieve.valuesType- the type for the values of the map to retrieve.- Returns:
- the value of the
ith element as a map ofKtoVobjects.
-
getUDTValue
public UDTValue getUDTValue(int i)
Return theith value as a UDT value.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to aUDTValue(if the CQL type is a UDT, the registry will generate a codec automatically).- Specified by:
getUDTValuein interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a UDT value. If the value is NULL, thennullwill be returned.
-
getTupleValue
public TupleValue getTupleValue(int i)
Return theith value as a tuple value.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to aTupleValue(if the CQL type is a tuple, the registry will generate a codec automatically).- Specified by:
getTupleValuein interfaceGettableByIndexData- Parameters:
i- the index (0 <= i < size()) to retrieve.- Returns:
- the value of the
ith element as a tuple value. If the value is NULL, thennullwill be returned.
-
getObject
public java.lang.Object getObject(int i)
Returns theith value as the Java type matching its CQL type.This method uses the
CodecRegistryto find the first codec that handles the underlying CQL type. The Java type of the returned object will be determined by the codec that was selected.Use this method to dynamically inspect elements when types aren't known in advance, for instance if you're writing a generic row logger. If you know the target Java type, it is generally preferable to use typed getters, such as the ones for built-in types (
GettableByIndexData.getBool(int),GettableByIndexData.getInt(int), etc.), orGettableByIndexData.get(int, Class)andGettableByIndexData.get(int, TypeToken)for custom types.- Specified by:
getObjectin interfaceGettableByIndexData- Parameters:
i- the index to retrieve.- Returns:
- the value of the
ith value as the Java type matching its CQL type. - See Also:
CodecRegistry.codecFor(DataType)
-
get
public <T> T get(int i, java.lang.Class<T> targetClass)Description copied from interface:GettableByIndexDataReturns theith value converted to the given Java type.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to the given Java type.If the target type is generic, use
GettableByIndexData.get(int, TypeToken).Implementation note: the actual object returned by this method will depend on the
codecbeing used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQLNULLvalues is also codec-dependent; by default, a CQLNULLvalue translates tonullfor simple CQL types, UDTs and tuples, and to empty collections for all CQL collection types.- Specified by:
getin interfaceGettableByIndexData- Parameters:
i- the index to retrieve.targetClass- The Java type the value should be converted to.- Returns:
- the value of the
ith value converted to the given Java type.
-
get
public <T> T get(int i, com.google.common.reflect.TypeToken<T> targetType)Description copied from interface:GettableByIndexDataReturns theith value converted to the given Java type.This method uses the
CodecRegistryto find a codec to convert the underlying CQL type to the given Java type.Implementation note: the actual object returned by this method will depend on the
codecbeing used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQLNULLvalues is also codec-dependent; by default, a CQLNULLvalue translates tonullfor simple CQL types, UDTs and tuples, and to empty collections for all CQL collection types.- Specified by:
getin interfaceGettableByIndexData- Parameters:
i- the index to retrieve.targetType- The Java type the value should be converted to.- Returns:
- the value of the
ith value converted to the given Java type.
-
get
public <T> T get(int i, TypeCodec<T> codec)Description copied from interface:GettableByIndexDataReturns theith value converted using the givenTypeCodec.This method entirely bypasses the
CodecRegistryand 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
acceptsthe underlying CQL type; failing to do so may result inInvalidTypeExceptions being thrown.Implementation note: the actual object returned by this method will depend on the
codecbeing used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQLNULLvalues is also codec-dependent; by default, a CQLNULLvalue translates tonullfor simple CQL types, UDTs and tuples, and to empty collections for all CQL collection types.- Specified by:
getin interfaceGettableByIndexData- Parameters:
i- the index to retrieve.codec- TheTypeCodecto use to deserialize the value; may not benull.- Returns:
- the value of the
ith value converted using the givenTypeCodec.
-
-