/** * Retrieve a CQL object value for the specified column. * <p> * The default implementation calls {@link RowUtils#getRowValue(Row, int, Class)}. If no required type has been * specified, this method delegates to {@code getColumnValue(rs, index)}, which basically calls * {@link Row#getObject(int)} but applies some additional default conversion to appropriate value types. * * @param row is the {@link Row} holding the data, must not be {@literal null}. * @param index is the column index * @param requiredType the type that each result object is expected to match (or {@literal null} if none specified). * @return the Object value. * @throws DriverException in case of extraction failure * @see RowUtils#getRowValue(Row, int, Class) * @see #getColumnValue(Row, int) */ @Nullable protected Object getColumnValue(Row row, int index, @Nullable Class<?> requiredType) throws DriverException { if (requiredType != null) { return RowUtils.getRowValue(row, index, requiredType); } else { // No required type specified -> perform default extraction. return getColumnValue(row, index); } }
Object result = getColumnValue(row, 0, this.requiredType);