Class RowUtils
java.lang.Object
org.springframework.data.cassandra.core.cql.RowUtils
Generic utility methods for working with Cassandra. Mainly for internal use within the framework, but also useful for
custom CQL access code.
- Since:
- 2.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
getRowValue
(com.datastax.oss.driver.api.core.cql.Row row, int index, Class<?> requiredType) Retrieve a CQL column value from aRow
, using the specified value type.
-
Method Details
-
getRowValue
@Nullable public static Object getRowValue(com.datastax.oss.driver.api.core.cql.Row row, int index, @Nullable Class<?> requiredType) Retrieve a CQL column value from aRow
, using the specified value type.Uses the specifically typed
Row
accessor methods, falling back toGettableByIndex.getObject(int)
for unknown types.Note that the returned value may not be assignable to the specified required type, in case of an unknown type. Calling code needs to deal with this case appropriately, e.g. throwing a corresponding exception.
- Parameters:
row
- is theRow
holding the dataindex
- is the column indexrequiredType
- the required value type (may be null)- Returns:
- the value object
-