Package org.apache.cassandra.cql3
Class Tuples
java.lang.Object
org.apache.cassandra.cql3.Tuples
Static helper methods and classes for tuples.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSimilar to Value, but contains at least one NonTerminal, such as a non-pure functions or bind marker.static classRepresents a marker for a set of IN values that are tuples, like "SELECT ...static classA raw marker for an IN list of tuples, like "SELECT ...static classA terminal value for a list of IN values that are tuples.static classA raw, literal tuple.static classRepresents a marker for a single tuple, like "SELECT ... WHERE (a, b, c) > ?"static classA raw placeholder for a tuple of values for different multiple columns, each of which may have a different type.static classA tuple of terminal values (e.g (123, 'abc')). -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckIfTupleType(AbstractType<?> tuple) static ColumnSpecificationcomponentSpecOf(ColumnSpecification column, int component) static <T> TupleTypegetExactTupleTypeIfKnown(List<T> items, Function<T, AbstractType<?>> mapper) Returns the exact TupleType from the items if it can be known.static TupleTypegetTupleType(AbstractType<?> tuple) testTupleAssignment(ColumnSpecification receiver, List<? extends AssignmentTestable> elements) Tests that the tuple with the specified elements can be assigned to the specified column.static <T> StringtupleToString(Iterable<T> items, Function<T, String> mapper) Create aStringrepresentation of the tuple from the specified items associated to the tuples elements.static StringtupleToString(List<?> elements) Create aStringrepresentation of the tuple containing the specified elements.static voidvalidateTupleAssignableTo(ColumnSpecification receiver, List<? extends AssignmentTestable> elements) Checks if the tuple with the specified elements can be assigned to the specified column.
-
Method Details
-
componentSpecOf
-
tupleToString
Create aStringrepresentation of the tuple containing the specified elements.- Parameters:
elements- the tuple elements- Returns:
- a
Stringrepresentation of the tuple
-
tupleToString
Create aStringrepresentation of the tuple from the specified items associated to the tuples elements.- Parameters:
items- items associated to the tuple elementsmapper- the mapper used to map the items to theStringrepresentation of the tuple elements- Returns:
- a
Stringrepresentation of the tuple
-
getExactTupleTypeIfKnown
public static <T> TupleType getExactTupleTypeIfKnown(List<T> items, Function<T, AbstractType<?>> mapper) Returns the exact TupleType from the items if it can be known.- Parameters:
items- the items mapped to the tuple elementsmapper- the mapper used to retrieve the element types from the items- Returns:
- the exact TupleType from the items if it can be known or
null
-
validateTupleAssignableTo
public static void validateTupleAssignableTo(ColumnSpecification receiver, List<? extends AssignmentTestable> elements) Checks if the tuple with the specified elements can be assigned to the specified column.- Parameters:
receiver- the receiving columnelements- the tuple elements- Throws:
InvalidRequestException- if the tuple cannot be assigned to the specified column.
-
testTupleAssignment
public static AssignmentTestable.TestResult testTupleAssignment(ColumnSpecification receiver, List<? extends AssignmentTestable> elements) Tests that the tuple with the specified elements can be assigned to the specified column.- Parameters:
receiver- the receiving columnelements- the tuple elements
-
checkIfTupleType
-
getTupleType
-