Package org.apache.cassandra.cql3
Class Lists
java.lang.Object
org.apache.cassandra.cql3.Lists
Static helper methods and classes for lists.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classBasically similar to a Value, but with some non-pure function (that need to be evaluated at execution time) in it.static classstatic classstatic classstatic classA marker for List values and IN relationsstatic classstatic classstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ListType<?>getExactListTypeIfKnown(List<T> items, Function<T, AbstractType<?>> mapper) Returns the exact ListType from the items if it can be known.static <T> ListType<?>getPreferredCompatibleType(List<T> items, Function<T, AbstractType<?>> mapper) static ColumnSpecificationindexSpecOf(ColumnSpecification column) static <T> StringlistToString(Iterable<T> items, Function<T, String> mapper) Create aStringrepresentation of the list from the specified items associated to the list elements.static StringlistToString(List<?> elements) Create aStringrepresentation of the list containing the specified elements.testListAssignment(ColumnSpecification receiver, List<? extends AssignmentTestable> elements) Tests that the list with the specified elements can be assigned to the specified column.static ColumnSpecificationvalueSpecOf(ColumnSpecification column)
-
Method Details
-
indexSpecOf
-
valueSpecOf
-
testListAssignment
public static AssignmentTestable.TestResult testListAssignment(ColumnSpecification receiver, List<? extends AssignmentTestable> elements) Tests that the list with the specified elements can be assigned to the specified column.- Parameters:
receiver- the receiving columnelements- the list elements
-
listToString
Create aStringrepresentation of the list containing the specified elements.- Parameters:
elements- the list elements- Returns:
- a
Stringrepresentation of the list
-
listToString
Create aStringrepresentation of the list from the specified items associated to the list elements.- Parameters:
items- items associated to the list elementsmapper- the mapper used to map the items to theStringrepresentation of the list elements- Returns:
- a
Stringrepresentation of the list
-
getExactListTypeIfKnown
public static <T> ListType<?> getExactListTypeIfKnown(List<T> items, Function<T, AbstractType<?>> mapper) Returns the exact ListType from the items if it can be known.- Parameters:
items- the items mapped to the list elementsmapper- the mapper used to retrieve the element types from the items- Returns:
- the exact ListType from the items if it can be known or
null
-
getPreferredCompatibleType
public static <T> ListType<?> getPreferredCompatibleType(List<T> items, Function<T, AbstractType<?>> mapper)
-