Class BoundStatement

  • All Implemented Interfaces:
    GettableByIndexData, GettableByNameData, GettableData, SettableByIndexData<BoundStatement>, SettableByNameData<BoundStatement>, SettableData<BoundStatement>

    public class BoundStatement
    extends Statement
    implements SettableData<BoundStatement>, GettableData
    A prepared statement with values bound to the bind variables.

    Once values has been provided for the variables of the PreparedStatement it has been created from, such BoundStatement can be executed (through Session.execute(Statement)).

    The values of a BoundStatement can be set by either index or name. When setting them by name, names follow the case insensitivity rules explained in ColumnDefinitions but with the difference that if multiple bind variables have the same name, setting that name will set all the variables for that name.

    With native protocol V3 or below, all variables of the statement must be bound. If you don't explicitly set a value for a variable, an IllegalStateException will be thrown when submitting the statement. If you want to set a variable to null, use setToNull.

    With native protocol V4 or above, variables can be left unset, in which case they will be ignored server side (no tombstones will be generated). If you're reusing a bound statement, you can unset variables that were previously set.

    This class is not thread-safe. Do not share instances among requests that will execute concurrently (e.g. requests run from separate application threads, but also separate executeAsync calls, even if they're triggered from the same thread).

    • Constructor Detail

      • BoundStatement

        public BoundStatement​(PreparedStatement statement)
        Creates a new BoundStatement from the provided prepared statement.
        Parameters:
        statement - the prepared statement from which to create a BoundStatement.
    • Method Detail

      • isLWT

        public boolean isLWT()
        Overrides:
        isLWT in class Statement
      • getPartitioner

        public com.datastax.driver.core.Token.Factory getPartitioner()
        Description copied from class: Statement
        The partitioner for this query.
        Overrides:
        getPartitioner in class Statement
        Returns:
        the partitioner for this query, or null if no partitioner has been specified. In the latter case, the cluster-wide partitioner will be used.
      • preparedStatement

        public PreparedStatement preparedStatement()
        Returns the prepared statement on which this BoundStatement is based.
        Returns:
        the prepared statement on which this BoundStatement is based.
      • isSet

        public boolean isSet​(int i)
        Returns whether the ith variable has been bound.
        Parameters:
        i - the index of the variable to check.
        Returns:
        whether the ith variable has been bound.
        Throws:
        IndexOutOfBoundsException - if i < 0 || i >= this.preparedStatement().variables().size().
      • isSet

        public boolean isSet​(String name)
        Returns whether the first occurrence of variable name has been bound.
        Parameters:
        name - the name of the variable to check.
        Returns:
        whether the first occurrence of variable name has been bound to a non-null value.
        Throws:
        IllegalArgumentException - if name is not a prepared variable, that is if !this.preparedStatement().variables().names().contains(name).
      • unset

        public void unset​(int i)
        Unsets the ith variable. This will leave the statement in the same state as if no setter was ever called for this variable.

        The treatment of unset variables depends on the native protocol version, see BoundStatement for explanations.

        Parameters:
        i - the index of the variable.
        Throws:
        IndexOutOfBoundsException - if i < 0 || i >= this.preparedStatement().variables().size().
      • unset

        public void unset​(String name)
        Unsets all occurrences of variable name. This will leave the statement in the same state as if no setter was ever called for this variable.

        The treatment of unset variables depends on the native protocol version, see BoundStatement for explanations.

        Parameters:
        name - the name of the variable.
        Throws:
        IllegalArgumentException - if name is not a prepared variable, that is if !this.preparedStatement().variables().names().contains(name).
      • bind

        public BoundStatement bind​(Object... values)
        Bound values to the variables of this statement.

        This is a convenience method to bind all the variables of the BoundStatement in one call.

        Parameters:
        values - the values to bind to the variables of the newly created BoundStatement. The first element of values will be bound to the first bind variable, etc. It is legal to provide fewer values than the statement has bound variables. In that case, the remaining variable need to be bound before execution. If more values than variables are provided however, an IllegalArgumentException wil be raised.
        Returns:
        this bound statement.
        Throws:
        IllegalArgumentException - if more values are provided than there is of bound variables in this statement.
        InvalidTypeException - if any of the provided value is not of correct type to be bound to the corresponding bind variable.
        NullPointerException - if one of values is a collection (List, Set or Map) containing a null value. Nulls are not supported in collections by CQL.
      • getRoutingKey

        public ByteBuffer getRoutingKey​(ProtocolVersion protocolVersion,
                                        CodecRegistry codecRegistry)
        The routing key for this bound query.

        This method will return a non-null value if either of the following occur:

        Otherwise, null is returned.

        Note that if the routing key has been set through setRoutingKey(java.nio.ByteBuffer), then that takes precedence. If the routing key has been set through PreparedStatement.setRoutingKey(java.nio.ByteBuffer) then that is used next. If neither of those are set then it is computed.

        Specified by:
        getRoutingKey in class Statement
        Parameters:
        protocolVersion - unused by this implementation (no internal serialization is required to compute the key).
        codecRegistry - unused by this implementation (no internal serialization is required to compute the key).
        Returns:
        the routing key for this statement or null.
      • setRoutingKey

        public BoundStatement setRoutingKey​(ByteBuffer routingKey)
        Sets the routing key for this bound statement.

        This is useful when the routing key can neither be set on the PreparedStatement this bound statement was built from, nor automatically computed from bound variables. In particular, this is the case if the partition key is composite and only some of its components are bound.

        Parameters:
        routingKey - the raw (binary) value to use as routing key.
        Returns:
        this BoundStatement object.
        See Also:
        getRoutingKey(com.datastax.driver.core.ProtocolVersion, com.datastax.driver.core.CodecRegistry)
      • setRoutingKey

        public BoundStatement setRoutingKey​(ByteBuffer... routingKeyComponents)
        Sets the routing key for this bound statement, when the query partition key is composite and the routing key must be built from multiple values.

        This is useful when the routing key can neither be set on the PreparedStatement this bound statement was built from, nor automatically computed from bound variables. In particular, this is the case if the partition key is composite and only some of its components are bound.

        Parameters:
        routingKeyComponents - the raw (binary) values to compose to obtain the routing key.
        Returns:
        this BoundStatement object.
        See Also:
        getRoutingKey(com.datastax.driver.core.ProtocolVersion, com.datastax.driver.core.CodecRegistry)
      • getKeyspace

        public String getKeyspace()
        Returns the keyspace this query operates on.

        Note that not all query specify on which keyspace they operate on, and so this method can always return null. Firstly, some queries do not operate inside a keyspace: keyspace creation, USE queries, user creation, etc. Secondly, even query that operate within a keyspace do not have to specify said keyspace directly, in which case the currently logged in keyspace (the one set through a USE query (or through the use of Cluster.connect(String))). Lastly, as for the routing key, this keyspace information is only a hint for token-aware routing (since replica placement depend on the replication strategy in use which is a per-keyspace property) and having this method return null (or even a bogus keyspace name) will never cause the query to fail.

        Specified by:
        getKeyspace in class Statement
        Returns:
        the keyspace this query operate on if relevant or null.
      • requestSizeInBytes

        public int requestSizeInBytes​(ProtocolVersion protocolVersion,
                                      CodecRegistry codecRegistry)
        Returns the number of bytes required to encode this statement.

        The calculated size may be overestimated by a few bytes, but is never underestimated. If the size cannot be calculated, this method returns -1.

        Note that the returned value is not cached, but instead recomputed at every method call.

        Overrides:
        requestSizeInBytes in class Statement
        Returns:
        the number of bytes required to encode this statement.
      • setBool

        public BoundStatement setBool​(int i,
                                      boolean v)
        Sets the ith value to the provided boolean.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type boolean, this will be the built-in codec).

        Specified by:
        setBool in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. To set the value to NULL, use SettableByIndexData.setToNull(int) or set(i, v, Boolean.class)
        Returns:
        this object.
      • setBool

        public BoundStatement setBool​(String name,
                                      boolean v)
        Sets the value for (all occurrences of) variable name to the provided boolean.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type boolean, this will be the built-in codec).

        Specified by:
        setBool in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. To set the value to NULL, use SettableByNameData.setToNull(String) or set(name, v, Boolean.class).
        Returns:
        this object.
      • setByte

        public BoundStatement setByte​(int i,
                                      byte v)
        Set the ith value to the provided byte.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type tinyint, this will be the built-in codec).

        Specified by:
        setByte in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. To set the value to NULL, use SettableByIndexData.setToNull(int) or set(i, v, Byte.class)
        Returns:
        this object.
      • setByte

        public BoundStatement setByte​(String name,
                                      byte v)
        Sets the value for (all occurrences of) variable name to the provided byte.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type tinyint, this will be the built-in codec).

        Specified by:
        setByte in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. To set the value to NULL, use SettableByNameData.setToNull(String) or set(name, v, Byte.class).
        Returns:
        this object.
      • setShort

        public BoundStatement setShort​(int i,
                                       short v)
        Set the ith value to the provided short.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type smallint, this will be the built-in codec).

        Specified by:
        setShort in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. To set the value to NULL, use SettableByIndexData.setToNull(int) or set(i, v, Short.class)
        Returns:
        this object.
      • setShort

        public BoundStatement setShort​(String name,
                                       short v)
        Sets the value for (all occurrences of) variable name to the provided short.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type smallint, this will be the built-in codec).

        Specified by:
        setShort in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. To set the value to NULL, use SettableByNameData.setToNull(String) or set(name, v, Short.class).
        Returns:
        this object.
      • setInt

        public BoundStatement setInt​(int i,
                                     int v)
        Set the ith value to the provided integer.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type int, this will be the built-in codec).

        Specified by:
        setInt in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. To set the value to NULL, use SettableByIndexData.setToNull(int) or set(i, v, Integer.class)
        Returns:
        this object.
      • setInt

        public BoundStatement setInt​(String name,
                                     int v)
        Sets the value for (all occurrences of) variable name to the provided integer.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type int, this will be the built-in codec).

        Specified by:
        setInt in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. To set the value to NULL, use SettableByNameData.setToNull(String) or set(name, v, Integer.class).
        Returns:
        this object.
      • setLong

        public BoundStatement setLong​(int i,
                                      long v)
        Sets the ith value to the provided long.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type bigint, this will be the built-in codec).

        Specified by:
        setLong in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. To set the value to NULL, use SettableByIndexData.setToNull(int) or set(i, v, Long.class)
        Returns:
        this object.
      • setLong

        public BoundStatement setLong​(String name,
                                      long v)
        Sets the value for (all occurrences of) variable name to the provided long.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type bigint, this will be the built-in codec).

        Specified by:
        setLong in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. To set the value to NULL, use SettableByNameData.setToNull(String) or set(name, v, Long.class).
        Returns:
        this object.
      • setTimestamp

        public BoundStatement setTimestamp​(int i,
                                           Date v)
        Set the ith value to the provided date.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type timestamp, this will be the built-in codec).

        Specified by:
        setTimestamp in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setTimestamp

        public BoundStatement setTimestamp​(String name,
                                           Date v)
        Sets the value for (all occurrences of) variable name to the provided date.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type timestamp, this will be the built-in codec).

        Specified by:
        setTimestamp in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setDate

        public BoundStatement setDate​(int i,
                                      LocalDate v)
        Set the ith value to the provided date (without time).

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type date, this will be the built-in codec).

        Specified by:
        setDate in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setDate

        public BoundStatement setDate​(String name,
                                      LocalDate v)
        Sets the value for (all occurrences of) variable name to the provided date (without time).

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type date, this will be the built-in codec).

        Specified by:
        setDate in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setTime

        public BoundStatement setTime​(int i,
                                      long v)
        Set the ith value to the provided time as a long in nanoseconds since midnight.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type time, this will be the built-in codec).

        Specified by:
        setTime in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setTime

        public BoundStatement setTime​(String name,
                                      long v)
        Sets the value for (all occurrences of) variable name to the provided time as a long in nanoseconds since midnight.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type time, this will be the built-in codec).

        Specified by:
        setTime in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setFloat

        public BoundStatement setFloat​(int i,
                                       float v)
        Sets the ith value to the provided float.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type float, this will be the built-in codec).

        Specified by:
        setFloat in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. To set the value to NULL, use SettableByIndexData.setToNull(int) or set(i, v, Float.class)
        Returns:
        this object.
      • setFloat

        public BoundStatement setFloat​(String name,
                                       float v)
        Sets the value for (all occurrences of) variable name to the provided float.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type float, this will be the built-in codec).

        Specified by:
        setFloat in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. To set the value to NULL, use SettableByNameData.setToNull(String) or set(name, v, Float.class).
        Returns:
        this object.
      • setDouble

        public BoundStatement setDouble​(int i,
                                        double v)
        Sets the ith value to the provided double.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type double, this will be the built-in codec).

        Specified by:
        setDouble in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. To set the value to NULL, use SettableByIndexData.setToNull(int) or set(i, v, Double.class).
        Returns:
        this object.
      • setDouble

        public BoundStatement setDouble​(String name,
                                        double v)
        Sets the value for (all occurrences of) variable name to the provided double.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type double, this will be the built-in codec).

        Specified by:
        setDouble in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. To set the value to NULL, use SettableByNameData.setToNull(String) or set(name, v, Double.class).
        Returns:
        this object.
      • setString

        public BoundStatement setString​(int i,
                                        String v)
        Sets the ith value to the provided string.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL types text, varchar and ascii, this will be the built-in codec).

        Specified by:
        setString in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setString

        public BoundStatement setString​(String name,
                                        String v)
        Sets the value for (all occurrences of) variable name to the provided string.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL types text, varchar and ascii, this will be the built-in codec).

        Specified by:
        setString in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setBytes

        public BoundStatement setBytes​(int i,
                                       ByteBuffer v)
        Sets the ith value to the provided byte buffer.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type blob, this will be the built-in codec).

        Specified by:
        setBytes in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setBytes

        public BoundStatement setBytes​(String name,
                                       ByteBuffer v)
        Sets the value for (all occurrences of) variable name to the provided byte buffer.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type blob, this will be the built-in codec).

        Specified by:
        setBytes in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setBytesUnsafe

        public BoundStatement setBytesUnsafe​(int i,
                                             ByteBuffer v)
        Sets the ith 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 InvalidQueryException at execute time.

        Specified by:
        setBytesUnsafe in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setBytesUnsafe

        public BoundStatement setBytesUnsafe​(String name,
                                             ByteBuffer v)
        Sets the value for (all occurrences of) variable name 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 InvalidQueryException at execute time.

        Specified by:
        setBytesUnsafe in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setVarint

        public BoundStatement setVarint​(int i,
                                        BigInteger v)
        Sets the ith value to the provided big integer.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type varint, this will be the built-in codec).

        Specified by:
        setVarint in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setVarint

        public BoundStatement setVarint​(String name,
                                        BigInteger v)
        Sets the value for (all occurrences of) variable name to the provided big integer.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type varint, this will be the built-in codec).

        Specified by:
        setVarint in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setDecimal

        public BoundStatement setDecimal​(int i,
                                         BigDecimal v)
        Sets the ith value to the provided big decimal.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type decimal, this will be the built-in codec).

        Specified by:
        setDecimal in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setDecimal

        public BoundStatement setDecimal​(String name,
                                         BigDecimal v)
        Sets the value for (all occurrences of) variable name to the provided big decimal.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type decimal, this will be the built-in codec).

        Specified by:
        setDecimal in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setUUID

        public BoundStatement setUUID​(int i,
                                      UUID v)
        Sets the ith value to the provided UUID.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL types uuid and timeuuid, this will be the built-in codec).

        Specified by:
        setUUID in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setUUID

        public BoundStatement setUUID​(String name,
                                      UUID v)
        Sets the value for (all occurrences of) variable name to the provided UUID.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL types uuid and timeuuid, this will be the built-in codec).

        Specified by:
        setUUID in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setInet

        public BoundStatement setInet​(int i,
                                      InetAddress v)
        Sets the ith value to the provided inet address.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type inet, this will be the built-in codec).

        Specified by:
        setInet in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setInet

        public BoundStatement setInet​(String name,
                                      InetAddress v)
        Sets the value for (all occurrences of) variable name to the provided inet address.

        This method uses the CodecRegistry to find a codec to handle the conversion to the underlying CQL type (for CQL type inet, this will be the built-in codec).

        Specified by:
        setInet in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setToken

        public BoundStatement setToken​(String name,
                                       Token v)
        Sets the value for (all occurrences of) variable name to the provided token.

        setPartitionKeyToken(Token) should generally be preferred if you have a single token variable.

        If you have multiple token variables, use positional binding (setToken(int, Token), or named bind markers:

        
         PreparedStatement pst = session.prepare("SELECT * FROM my_table WHERE token(k) > :min AND token(k) <= :max");
         BoundStatement b = pst.bind().setToken("min", minToken).setToken("max", maxToken);
         
        Parameters:
        name - the name of the variable to set; if multiple variables name are prepared, all of them are set.
        v - the value to set.
        Returns:
        this BoundStatement.
        Throws:
        IllegalArgumentException - if name is not a prepared variable, that is, if !this.preparedStatement().variables().names().contains(name).
        InvalidTypeException - if (any occurrence of) name is not of the type of the token's value.
      • setPartitionKeyToken

        public BoundStatement setPartitionKeyToken​(Token v)
        Sets the value for (all occurrences of) variable "partition key token" to the provided token (this is the name generated by Cassandra for markers corresponding to a token(...) call).

        This method is a shorthand for statements with a single token variable:

        
         Token token = ...
         PreparedStatement pst = session.prepare("SELECT * FROM my_table WHERE token(k) = ?");
         BoundStatement b = pst.bind().setPartitionKeyToken(token);
         
        If you have multiple token variables, use positional binding (setToken(int, Token), or named bind markers:
        
         PreparedStatement pst = session.prepare("SELECT * FROM my_table WHERE token(k) > :min AND token(k) <= :max");
         BoundStatement b = pst.bind().setToken("min", minToken).setToken("max", maxToken);
         
        Parameters:
        v - the value to set.
        Returns:
        this BoundStatement.
        Throws:
        IllegalArgumentException - if name is not a prepared variable, that is, if !this.preparedStatement().variables().names().contains(name).
        InvalidTypeException - if (any occurrence of) name is not of the type of the token's value.
      • setList

        public <E> BoundStatement setList​(int i,
                                          List<E> v,
                                          Class<E> elementsClass)
        Sets the ith value to the provided list, which elements are of the provided Java class.

        This method uses the CodecRegistry to 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:
        setList in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. Note that null values inside collections are not supported by CQL.
        elementsClass - the class for the elements of the list.
        Returns:
        this object.
      • setList

        public <E> BoundStatement setList​(int i,
                                          List<E> v,
                                          TypeToken<E> elementsType)
        Sets the ith value to the provided list, which elements are of the provided Java type.

        This method uses the CodecRegistry to find a codec to handle the conversion of lists of the given Java type to the underlying CQL type.

        Specified by:
        setList in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. Note that null values inside collections are not supported by CQL.
        elementsType - the type for the elements of the list.
        Returns:
        this object.
      • setList

        public <T> BoundStatement setList​(String name,
                                          List<T> v)
        Sets the value for (all occurrences of) variable name to the provided list.

        This method uses the CodecRegistry to 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 methods SettableByNameData.setList(String, List, Class) or SettableByNameData.setList(String, List, TypeToken).

        Specified by:
        setList in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. Note that null values inside collections are not supported by CQL.
        Returns:
        this object.
      • setList

        public <E> BoundStatement setList​(String name,
                                          List<E> v,
                                          Class<E> elementsClass)
        Sets the value for (all occurrences of) variable name to the provided list, which elements are of the provided Java class.

        This method uses the CodecRegistry to 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:
        setList in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple
        v - the value to set. Note that null values inside collections are not supported by CQL.
        elementsClass - the class for the elements of the list.
        Returns:
        this object.
      • setList

        public <E> BoundStatement setList​(String name,
                                          List<E> v,
                                          TypeToken<E> elementsType)
        Sets the value for (all occurrences of) variable name to the provided list, which elements are of the provided Java type.

        This method uses the CodecRegistry to find a codec to handle the conversion of lists of the given Java type to the underlying CQL type.

        Specified by:
        setList in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple
        v - the value to set. Note that null values inside collections are not supported by CQL.
        elementsType - the type for the elements of the list.
        Returns:
        this object.
      • setMap

        public <K,​V> BoundStatement setMap​(int i,
                                                 Map<K,​V> v,
                                                 Class<K> keysClass,
                                                 Class<V> valuesClass)
        Sets the ith value to the provided map, which keys and values are of the provided Java classes.

        This method uses the CodecRegistry to 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:
        setMap in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. Note that null values 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> BoundStatement setMap​(int i,
                                                 Map<K,​V> v,
                                                 TypeToken<K> keysType,
                                                 TypeToken<V> valuesType)
        Sets the ith value to the provided map, which keys and values are of the provided Java types.

        This method uses the CodecRegistry to find a codec to handle the conversion of lists of the given Java types to the underlying CQL type.

        Specified by:
        setMap in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. Note that null values 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> BoundStatement setMap​(String name,
                                                 Map<K,​V> v,
                                                 Class<K> keysClass,
                                                 Class<V> valuesClass)
        Sets the value for (all occurrences of) variable name to the provided map, which keys and values are of the provided Java classes.

        This method uses the CodecRegistry to 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:
        setMap in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. Note that null values 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> BoundStatement setMap​(String name,
                                                 Map<K,​V> v,
                                                 TypeToken<K> keysType,
                                                 TypeToken<V> valuesType)
        Sets the value for (all occurrences of) variable name to the provided map, which keys and values are of the provided Java types.

        This method uses the CodecRegistry to find a codec to handle the conversion of lists of the given Java types to the underlying CQL type.

        Specified by:
        setMap in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. Note that null values 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> BoundStatement setSet​(int i,
                                         Set<E> v,
                                         Class<E> elementsClass)
        Sets the ith value to the provided set, which elements are of the provided Java class.

        This method uses the CodecRegistry to 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:
        setSet in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. Note that null values inside collections are not supported by CQL.
        elementsClass - the class for the elements of the set.
        Returns:
        this object.
      • setSet

        public <E> BoundStatement setSet​(int i,
                                         Set<E> v,
                                         TypeToken<E> elementsType)
        Sets the ith value to the provided set, which elements are of the provided Java type.

        This method uses the CodecRegistry to find a codec to handle the conversion of sets of the given Java type to the underlying CQL type.

        Specified by:
        setSet in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set. Note that null values inside collections are not supported by CQL.
        elementsType - the type for the elements of the set.
        Returns:
        this object.
      • setSet

        public <T> BoundStatement setSet​(String name,
                                         Set<T> v)
        Sets the value for (all occurrences of) variable name to the provided set.

        This method uses the CodecRegistry to 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 methods SettableByNameData.setSet(String, Set, Class) or SettableByNameData.setSet(String, Set, TypeToken).

        Specified by:
        setSet in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set. Note that null values inside collections are not supported by CQL.
        Returns:
        this object.
      • setSet

        public <E> BoundStatement setSet​(String name,
                                         Set<E> v,
                                         Class<E> elementsClass)
        Sets the value for (all occurrences of) variable name to the provided set, which elements are of the provided Java class.

        This method uses the CodecRegistry to 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:
        setSet in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple
        v - the value to set. Note that null values inside collections are not supported by CQL.
        elementsClass - the class for the elements of the set.
        Returns:
        this object.
      • setSet

        public <E> BoundStatement setSet​(String name,
                                         Set<E> v,
                                         TypeToken<E> elementsType)
        Sets the value for (all occurrences of) variable name to the provided set, which elements are of the provided Java type.

        This method uses the CodecRegistry to find a codec to handle the conversion of sets of the given Java type to the underlying CQL type.

        Specified by:
        setSet in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple
        v - the value to set. Note that null values inside collections are not supported by CQL.
        elementsType - the type for the elements of the set.
        Returns:
        this object.
      • setUDTValue

        public BoundStatement setUDTValue​(int i,
                                          UDTValue v)
        Sets the ith value to the provided UDT value.

        This method uses the CodecRegistry to find a codec to handle the conversion of UDTValue to the underlying CQL type.

        Specified by:
        setUDTValue in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setUDTValue

        public BoundStatement setUDTValue​(String name,
                                          UDTValue v)
        Sets the value for (all occurrences of) variable name to the provided UDT value.

        This method uses the CodecRegistry to find a codec to handle the conversion of UDTValue to the underlying CQL type.

        Specified by:
        setUDTValue in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • setTupleValue

        public BoundStatement setTupleValue​(int i,
                                            TupleValue v)
        Sets the ith value to the provided tuple value.

        This method uses the CodecRegistry to find a codec to handle the conversion of TupleValue to the underlying CQL type.

        Specified by:
        setTupleValue in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set.
        Returns:
        this object.
      • setTupleValue

        public BoundStatement setTupleValue​(String name,
                                            TupleValue v)
        Sets the value for (all occurrences of) variable name to the provided tuple value.

        This method uses the CodecRegistry to find a codec to handle the conversion of TupleValue to the underlying CQL type.

        Specified by:
        setTupleValue in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set.
        Returns:
        this object.
      • set

        public <V> BoundStatement set​(int i,
                                      V v,
                                      Class<V> targetClass)
        Sets the ith value to the provided value of the provided Java class.

        This method uses the CodecRegistry to 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:
        set in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set; may be null.
        targetClass - The Java class to convert to; must not be null;
        Returns:
        this object.
      • set

        public <V> BoundStatement set​(String name,
                                      V v,
                                      Class<V> targetClass)
        Sets the value for (all occurrences of) variable name to the provided value of the provided Java class.

        This method uses the CodecRegistry to 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:
        set in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set; may be null.
        targetClass - The Java class to convert to; must not be null;
        Returns:
        this object.
      • set

        public <V> BoundStatement set​(int i,
                                      V v,
                                      TypeToken<V> targetType)
        Sets the ith value to the provided value of the provided Java type.

        This method uses the CodecRegistry to find a codec to handle the conversion of the provided Java type to the underlying CQL type.

        Specified by:
        set in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set; may be null.
        targetType - The Java type to convert to; must not be null;
        Returns:
        this object.
      • set

        public <V> BoundStatement set​(String name,
                                      V v,
                                      TypeToken<V> targetType)
        Sets the value for (all occurrences of) variable name to the provided value of the provided Java type.

        This method uses the CodecRegistry to find a codec to handle the conversion of the provided Java type to the underlying CQL type.

        Specified by:
        set in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set; may be null.
        targetType - The Java type to convert to; must not be null;
        Returns:
        this object.
      • set

        public <V> BoundStatement set​(int i,
                                      V v,
                                      TypeCodec<V> codec)
        Sets the ith value to the provided value, converted using the given TypeCodec.

        This method entirely bypasses the 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 accepts the underlying CQL type; failing to do so may result in InvalidTypeExceptions being thrown.

        Specified by:
        set in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        v - the value to set; may be null.
        codec - The TypeCodec to use to serialize the value; may not be null.
        Returns:
        this object.
      • set

        public <V> BoundStatement set​(String name,
                                      V v,
                                      TypeCodec<V> codec)
        Sets the value for (all occurrences of) variable name to the provided value, converted using the given TypeCodec.

        This method entirely bypasses the 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 accepts the underlying CQL type; failing to do so may result in InvalidTypeExceptions being thrown.

        Specified by:
        set in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        v - the value to set; may be null.
        codec - The TypeCodec to use to serialize the value; may not be null.
        Returns:
        this object.
      • setToNull

        public BoundStatement setToNull​(int i)
        Sets the ith value to null.

        This is mainly intended for CQL types which map to native Java types.

        Specified by:
        setToNull in interface SettableByIndexData<BoundStatement>
        Parameters:
        i - the index of the value to set.
        Returns:
        this object.
      • setToNull

        public BoundStatement setToNull​(String name)
        Sets the value for (all occurrences of) variable name to null.

        This is mainly intended for CQL types which map to native Java types.

        Specified by:
        setToNull in interface SettableByNameData<BoundStatement>
        Parameters:
        name - the name of the value to set; if name is present multiple times, all its values are set.
        Returns:
        this object.
      • isNull

        public boolean isNull​(int i)
        Returns whether the ith value is NULL.
        Specified by:
        isNull in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) of the value to check.
        Returns:
        whether the ith value is NULL.
      • isNull

        public boolean isNull​(String name)
        Returns whether the value for name is NULL.
        Specified by:
        isNull in interface GettableByNameData
        Parameters:
        name - the name to check.
        Returns:
        whether the value for name is NULL.
      • getBool

        public boolean getBool​(int i)
        Returns the ith value as a boolean.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java boolean (for CQL type boolean, this will be the built-in codec).

        Specified by:
        getBool in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the boolean value of the ith element. If the value is NULL, false is returned. If you need to distinguish NULL and false values, check first with GettableByIndexData.isNull(int) or use get(i, Boolean.class).
      • getBool

        public boolean getBool​(String name)
        Returns the value for name as a boolean.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java boolean (for CQL type boolean, this will be the built-in codec).

        Specified by:
        getBool in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the boolean value for name. If the value is NULL, false is returned. If you need to distinguish NULL and false values, check first with GettableByNameData.isNull(String) or use get(name, Boolean.class).
      • getByte

        public byte getByte​(int i)
        Returns the ith value as a byte.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java byte (for CQL type tinyint, this will be the built-in codec).

        Specified by:
        getByte in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as a byte. If the value is NULL, 0 is returned. If you need to distinguish NULL and 0, check first with GettableByIndexData.isNull(int) or use get(i, Byte.class).
      • getByte

        public byte getByte​(String name)
        Returns the value for name as a byte.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java byte (for CQL type tinyint, this will be the built-in codec).

        Specified by:
        getByte in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a byte. If the value is NULL, 0 is returned. If you need to distinguish NULL and 0, check first with GettableByNameData.isNull(String) or use get(name, Byte.class). 0 is returned.
      • getShort

        public short getShort​(int i)
        Returns the ith value as a short.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java short (for CQL type smallint, this will be the built-in codec).

        Specified by:
        getShort in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as a short. If the value is NULL, 0 is returned. If you need to distinguish NULL and 0, check first with GettableByIndexData.isNull(int) or use get(i, Short.class).
      • getShort

        public short getShort​(String name)
        Returns the value for name as a short.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java short (for CQL type smallint, this will be the built-in codec).

        Specified by:
        getShort in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a short. If the value is NULL, 0 is returned. If you need to distinguish NULL and 0, check first with GettableByNameData.isNull(String) or use get(name, Short.class). 0 is returned.
      • getInt

        public int getInt​(int i)
        Returns the ith value as an integer.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java int (for CQL type int, this will be the built-in codec).

        Specified by:
        getInt in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as an integer. If the value is NULL, 0 is returned. If you need to distinguish NULL and 0, check first with GettableByIndexData.isNull(int) or use get(i, Integer.class).
      • getInt

        public int getInt​(String name)
        Returns the value for name as an integer.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java int (for CQL type int, this will be the built-in codec).

        Specified by:
        getInt in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as an integer. If the value is NULL, 0 is returned. If you need to distinguish NULL and 0, check first with GettableByNameData.isNull(String) or use get(name, Integer.class). 0 is returned.
      • getLong

        public long getLong​(int i)
        Returns the ith value as a long.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java byte (for CQL types bigint and counter, this will be the built-in codec).

        Specified by:
        getLong in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as a long. If the value is NULL, 0L is returned. If you need to distinguish NULL and 0L, check first with GettableByIndexData.isNull(int) or use get(i, Long.class).
      • getLong

        public long getLong​(String name)
        Returns the value for name as a long.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java byte (for CQL types bigint and counter, this will be the built-in codec).

        Specified by:
        getLong in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a long. If the value is NULL, 0L is returned. If you need to distinguish NULL and 0L, check first with GettableByNameData.isNull(String) or use get(name, Long.class).
      • getTimestamp

        public Date getTimestamp​(int i)
        Returns the ith value as a date.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Date (for CQL type timestamp, this will be the built-in codec).

        Specified by:
        getTimestamp in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as a data. If the value is NULL, null is returned.
      • getTimestamp

        public Date getTimestamp​(String name)
        Returns the value for name as a date.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Date (for CQL type timestamp, this will be the built-in codec).

        Specified by:
        getTimestamp in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a date. If the value is NULL, null is returned.
      • getDate

        public LocalDate getDate​(int i)
        Returns the ith value as a date (without time).

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a LocalDate (for CQL type date, this will be the built-in codec).

        Specified by:
        getDate in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as an date. If the value is NULL, null is returned.
      • getDate

        public LocalDate getDate​(String name)
        Returns the value for name as a date (without time).

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a LocalDate (for CQL type date, this will be the built-in codec).

        Specified by:
        getDate in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a date. If the value is NULL, null is returned.
      • getTime

        public long getTime​(int i)
        Returns the ith value as a long in nanoseconds since midnight.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java long (for CQL type time, this will be the built-in codec).

        Specified by:
        getTime in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as a long. If the value is NULL, 0L is returned.
      • getTime

        public long getTime​(String name)
        Returns the value for name as a long in nanoseconds since midnight.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java long (for CQL type time, this will be the built-in codec).

        Specified by:
        getTime in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a long. If the value is NULL, 0L is returned.
      • getFloat

        public float getFloat​(int i)
        Returns the ith value as a float.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java float (for CQL type float, this will be the built-in codec).

        Specified by:
        getFloat in interface GettableByIndexData
        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.0f is returned. If you need to distinguish NULL and 0.0f, check first with GettableByIndexData.isNull(int) or use get(i, Float.class).
      • getFloat

        public float getFloat​(String name)
        Returns the value for name as a float.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java float (for CQL type float, this will be the built-in codec).

        Specified by:
        getFloat in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a float. If the value is NULL, 0.0f is returned. If you need to distinguish NULL and 0.0f, check first with GettableByNameData.isNull(String) or use get(name, Float.class).
      • getDouble

        public double getDouble​(int i)
        Returns the ith value as a double.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java double (for CQL type double, this will be the built-in codec).

        Specified by:
        getDouble in interface GettableByIndexData
        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.0 is returned. If you need to distinguish NULL and 0.0, check first with GettableByIndexData.isNull(int) or use get(i, Double.class).
      • getDouble

        public double getDouble​(String name)
        Returns the value for name as a double.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java double (for CQL type double, this will be the built-in codec).

        Specified by:
        getDouble in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a double. If the value is NULL, 0.0 is returned. If you need to distinguish NULL and 0.0, check first with GettableByNameData.isNull(String) or use get(name, Double.class).
      • getBytesUnsafe

        public ByteBuffer getBytesUnsafe​(int i)
        Returns the ith value as a ByteBuffer.

        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:
        getBytesUnsafe in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as a ByteBuffer. If the value is NULL, null is returned.
      • getBytesUnsafe

        public ByteBuffer getBytesUnsafe​(String name)
        Returns the value for name as a ByteBuffer.

        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.

        Note: this method always return the bytes composing the value, even if the column is not of type BLOB. That is, this method never throw an InvalidTypeException. However, if the type is not BLOB, it is up to the caller to handle the returned value correctly.

        Specified by:
        getBytesUnsafe in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a ByteBuffer. If the value is NULL, null is returned.
      • getBytes

        public ByteBuffer getBytes​(int i)
        Returns the ith value as a byte array.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java ByteBuffer (for CQL type blob, this will be the built-in codec).

        Specified by:
        getBytes in interface GettableByIndexData
        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, null is returned.
      • getBytes

        public ByteBuffer getBytes​(String name)
        Returns the value for name as a byte array.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java ByteBuffer (for CQL type blob, this will be the built-in codec).

        Specified by:
        getBytes in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a byte array. If the value is NULL, null is returned.
      • getString

        public String getString​(int i)
        Returns the ith value as a string.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java string (for CQL types text, varchar and ascii, this will be the built-in codec).

        Specified by:
        getString in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as a string. If the value is NULL, null is returned.
      • getString

        public String getString​(String name)
        Returns the value for name as a string.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a Java string (for CQL types text, varchar and ascii, this will be the built-in codec).

        Specified by:
        getString in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a string. If the value is NULL, null is returned.
      • getVarint

        public BigInteger getVarint​(int i)
        Returns the ith value as a variable length integer.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a BigInteger (for CQL type varint, this will be the built-in codec).

        Specified by:
        getVarint in interface GettableByIndexData
        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, null is returned.
      • getVarint

        public BigInteger getVarint​(String name)
        Returns the value for name as a variable length integer.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a BigInteger (for CQL type varint, this will be the built-in codec).

        Specified by:
        getVarint in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a variable length integer. If the value is NULL, null is returned.
      • getDecimal

        public BigDecimal getDecimal​(int i)
        Returns the ith value as a variable length decimal.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a BigDecimal (for CQL type decimal, this will be the built-in codec).

        Specified by:
        getDecimal in interface GettableByIndexData
        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, null is returned.
      • getDecimal

        public BigDecimal getDecimal​(String name)
        Returns the value for name as a variable length decimal.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a BigDecimal (for CQL type decimal, this will be the built-in codec).

        Specified by:
        getDecimal in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a variable length decimal. If the value is NULL, null is returned.
      • getUUID

        public UUID getUUID​(int i)
        Returns the ith value as a UUID.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a UUID (for CQL types uuid and timeuuid, this will be the built-in codec).

        Specified by:
        getUUID in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as a UUID. If the value is NULL, null is returned.
      • getUUID

        public UUID getUUID​(String name)
        Returns the value for name as a UUID.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a UUID (for CQL types uuid and timeuuid, this will be the built-in codec).

        Specified by:
        getUUID in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as a UUID. If the value is NULL, null is returned.
      • getInet

        public InetAddress getInet​(int i)
        Returns the ith value as an InetAddress.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to an InetAddress (for CQL type inet, this will be the built-in codec).

        Specified by:
        getInet in interface GettableByIndexData
        Parameters:
        i - the index (0 <= i < size()) to retrieve.
        Returns:
        the value of the ith element as an InetAddress. If the value is NULL, null is returned.
      • getInet

        public InetAddress getInet​(String name)
        Returns the value for name as an InetAddress.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to an InetAddress (for CQL type inet, this will be the built-in codec).

        Specified by:
        getInet in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value for name as an InetAddress. If the value is NULL, null is returned.
      • getList

        public <T> List<T> getList​(int i,
                                   Class<T> elementsClass)
        Returns the ith value as a list.

        This method uses the CodecRegistry to 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 List implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will be mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getList in interface GettableByIndexData
        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 of T objects.
      • getList

        public <T> List<T> getList​(int i,
                                   TypeToken<T> elementsType)
        Returns the ith value as a list.

        This method uses the CodecRegistry to 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 List implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getList in interface GettableByIndexData
        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 of T objects.
      • getList

        public <T> List<T> getList​(String name,
                                   Class<T> elementsClass)
        Returns the value for name as a list.

        This method uses the CodecRegistry to 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 GettableByNameData.getList(String, TypeToken).

        Implementation note: the actual List implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getList in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        elementsClass - the class for the elements of the list to retrieve.
        Returns:
        the value of the ith element as a list of T objects.
      • getList

        public <T> List<T> getList​(String name,
                                   TypeToken<T> elementsType)
        Returns the value for name as a list.

        This method uses the CodecRegistry to 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("theColumn", new TypeToken<List<String>>() {});
         

        Implementation note: the actual List implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getList in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        elementsType - the type for the elements of the list to retrieve.
        Returns:
        the value of the ith element as a list of T objects.
      • getSet

        public <T> Set<T> getSet​(int i,
                                 Class<T> elementsClass)
        Returns the ith value as a set.

        This method uses the CodecRegistry to 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 Set implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getSet in interface GettableByIndexData
        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 of T objects.
      • getSet

        public <T> Set<T> getSet​(int i,
                                 TypeToken<T> elementsType)
        Returns the ith value as a set.

        This method uses the CodecRegistry to 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 Set implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getSet in interface GettableByIndexData
        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 of T objects.
      • getSet

        public <T> Set<T> getSet​(String name,
                                 Class<T> elementsClass)
        Returns the value for name as a set.

        This method uses the CodecRegistry to 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 GettableByNameData.getSet(String, TypeToken).

        Implementation note: the actual Set implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getSet in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        elementsClass - the class for the elements of the set to retrieve.
        Returns:
        the value of the ith element as a set of T objects.
      • getSet

        public <T> Set<T> getSet​(String name,
                                 TypeToken<T> elementsType)
        Returns the value for name as a set.

        This method uses the CodecRegistry to 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("theColumn", new TypeToken<List<String>>() {});
         

        Implementation note: the actual Set implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getSet in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        elementsType - the type for the elements of the set to retrieve.
        Returns:
        the value of the ith element as a set of T objects.
      • getMap

        public <K,​V> Map<K,​V> getMap​(int i,
                                                 Class<K> keysClass,
                                                 Class<V> valuesClass)
        Returns the ith value as a map.

        This method uses the CodecRegistry to 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 Map implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getMap in interface GettableByIndexData
        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 of K to V objects.
      • getMap

        public <K,​V> Map<K,​V> getMap​(int i,
                                                 TypeToken<K> keysType,
                                                 TypeToken<V> valuesType)
        Returns the ith value as a map.

        This method uses the CodecRegistry to 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 Map implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getMap in interface GettableByIndexData
        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 of K to V objects.
      • getMap

        public <K,​V> Map<K,​V> getMap​(String name,
                                                 Class<K> keysClass,
                                                 Class<V> valuesClass)
        Returns the value for name as a map.

        This method uses the CodecRegistry to 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 GettableByNameData.getMap(String, TypeToken, TypeToken).

        Implementation note: the actual Map implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getMap in interface GettableByNameData
        Parameters:
        name - the name 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 name as a map of K to V objects.
      • getMap

        public <K,​V> Map<K,​V> getMap​(String name,
                                                 TypeToken<K> keysType,
                                                 TypeToken<V> valuesType)
        Returns the value for name as a map.

        This method uses the CodecRegistry to 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("theColumn", TypeToken.of(Integer.class), new TypeToken<List<String>>() {});
         

        Implementation note: the actual Map implementation will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent. By default, the driver will return mutable instances, and a CQL NULL will mapped to an empty collection (note that Cassandra makes no distinction between NULL and an empty collection).

        Specified by:
        getMap in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        keysType - the class for the keys of the map to retrieve.
        valuesType - the class for the values of the map to retrieve.
        Returns:
        the value of name as a map of K to V objects.
      • getUDTValue

        public UDTValue getUDTValue​(int i)
        Return the ith value as a UDT value.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a UDTValue (if the CQL type is a UDT, the registry will generate a codec automatically).

        Specified by:
        getUDTValue in interface GettableByIndexData
        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, then null will be returned.
      • getUDTValue

        public UDTValue getUDTValue​(String name)
        Return the value for name as a UDT value.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a UDTValue (if the CQL type is a UDT, the registry will generate a codec automatically).

        Specified by:
        getUDTValue in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value of name as a UDT value. If the value is NULL, then null will be returned.
      • getTupleValue

        public TupleValue getTupleValue​(int i)
        Return the ith value as a tuple value.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a TupleValue (if the CQL type is a tuple, the registry will generate a codec automatically).

        Specified by:
        getTupleValue in interface GettableByIndexData
        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, then null will be returned.
      • getTupleValue

        public TupleValue getTupleValue​(String name)
        Return the value for name as a tuple value.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to a TupleValue (if the CQL type is a tuple, the registry will generate a codec automatically).

        Specified by:
        getTupleValue in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        Returns:
        the value of name as a tuple value. If the value is NULL, then null will be returned.
      • get

        public <T> T get​(int i,
                         Class<T> targetClass)
        Returns the ith value converted to the given Java type.

        This method uses the CodecRegistry to 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 codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent; by default, a CQL NULL value translates to null for simple CQL types, UDTs and tuples, and to empty collections for all CQL collection types.

        Specified by:
        get in interface GettableByIndexData
        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​(String name,
                         Class<T> targetClass)
        Returns the value for name converted to the given Java type.

        This method uses the CodecRegistry to find a codec to convert the underlying CQL type to the given Java type.

        If the target type is generic, use GettableByNameData.get(String, TypeToken).

        Implementation note: the actual object returned by this method will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent; by default, a CQL NULL value translates to null for simple CQL types, UDTs and tuples, and to empty collections for all CQL collection types.

        Specified by:
        get in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        targetClass - The Java type the value should be converted to.
        Returns:
        the value for name value converted to the given Java type.
      • get

        public <T> T get​(int i,
                         TypeToken<T> targetType)
        Returns the ith value converted to the given Java type.

        This method uses the CodecRegistry to 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 codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent; by default, a CQL NULL value translates to null for simple CQL types, UDTs and tuples, and to empty collections for all CQL collection types.

        Specified by:
        get in interface GettableByIndexData
        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​(String name,
                         TypeToken<T> targetType)
        Returns the value for name converted to the given Java type.

        This method uses the CodecRegistry to 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 codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent; by default, a CQL NULL value translates to null for simple CQL types, UDTs and tuples, and to empty collections for all CQL collection types.

        Specified by:
        get in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        targetType - The Java type the value should be converted to.
        Returns:
        the value for name value converted to the given Java type.
      • get

        public <T> T get​(int i,
                         TypeCodec<T> codec)
        Returns the ith value converted using the given TypeCodec.

        This method entirely bypasses the 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 accepts the underlying CQL type; failing to do so may result in InvalidTypeExceptions being thrown.

        Implementation note: the actual object returned by this method will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent; by default, a CQL NULL value translates to null for simple CQL types, UDTs and tuples, and to empty collections for all CQL collection types.

        Specified by:
        get in interface GettableByIndexData
        Parameters:
        i - the index to retrieve.
        codec - The TypeCodec to use to deserialize the value; may not be null.
        Returns:
        the value of the ith value converted using the given TypeCodec.
      • get

        public <T> T get​(String name,
                         TypeCodec<T> codec)
        Returns the value for name converted using the given TypeCodec.

        This method entirely bypasses the 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 accepts the underlying CQL type; failing to do so may result in InvalidTypeExceptions being thrown.

        Implementation note: the actual object returned by this method will depend on the codec being used; therefore, callers should make no assumptions concerning its mutability nor its thread-safety. Furthermore, the behavior of this method in respect to CQL NULL values is also codec-dependent; by default, a CQL NULL value translates to null for simple CQL types, UDTs and tuples, and to empty collections for all CQL collection types.

        Specified by:
        get in interface GettableByNameData
        Parameters:
        name - the name to retrieve.
        codec - The TypeCodec to use to deserialize the value; may not be null.
        Returns:
        the value of the ith value converted using the given TypeCodec.