@Test public void testTupleValueToList() { TupleType tupleType = TupleType.of( DataType.varchar(), DataType.cboolean(), DataType.cint(), DataType.cfloat(), DataType.cdouble()); TupleValue tupleValue = tupleType.newValue("foo", false, 123, 123.456f, 234.567); List<Object> values = CqlUtils.toList(tupleValue); assertEquals(Lists.newArrayList("foo", false, 123, 123.456f, 234.567), values); }
public static List<Object> toList(TupleValue tuple) { List<DataType> componentTypes = tuple.getType().getComponentTypes(); List<Object> results = new ArrayList<>(componentTypes.size()); int index = 0; for (DataType dataType : componentTypes) { results.add(getValue(tuple, index++, dataType)); } return results; }
CqlUtils { public static List<Object> toList(TupleValue tuple) { List<DataType> componentTypes = tuple.getType().getComponentTypes(); List<Object> results = new ArrayList<>(componentTypes.size()); int index = 0; for (DataType dataType : componentTypes) { results.add(getValue(tuple, index++, dataType)); } return results; } }
CqlUtils { public static List<Object> toList(TupleValue tuple) { List<DataType> componentTypes = tuple.getType().getComponentTypes(); List<Object> results = new ArrayList<>(componentTypes.size()); int index = 0; for (DataType dataType : componentTypes) { results.add(getValue(tuple, index++, dataType)); } return results; } private  CqlUtils(); }
CqlUtils { public static List<Object> toList(TupleValue tuple) { List<DataType> componentTypes = tuple.getType().getComponentTypes(); List<Object> results = new ArrayList<>(componentTypes.size()); int index = 0; for (DataType dataType : componentTypes) { results.add(getValue(tuple, index++, dataType)); } return results; } private  CqlUtils(); static BoundStatement bind(PreparedStatement statement, Object[] params); static Object getValue(GettableByIndexData gettable, int columnIndex, DataType dataType); static List<Object> toList(TupleValue tuple); static List<Object> toList(Row row); }
CqlUtils { public static List<Object> toList(TupleValue tuple) { List<DataType> componentTypes = tuple.getType().getComponentTypes(); List<Object> results = new ArrayList<>(componentTypes.size()); int index = 0; for (DataType dataType : componentTypes) { results.add(getValue(tuple, index++, dataType)); } return results; } private  CqlUtils(); static BoundStatement bind(PreparedStatement statement, Object[] params); static Object getValue(GettableByIndexData gettable, int columnIndex, DataType dataType); static List<Object> toList(TupleValue tuple); static List<Object> toList(Row row); static final Logger CQL_LOGGER; }