Package org.apache.cassandra.cql3
Class Lists
- java.lang.Object
-
- org.apache.cassandra.cql3.Lists
-
public abstract class Lists extends java.lang.ObjectStatic helper methods and classes for lists.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLists.Appenderstatic classLists.DelayedValueBasically similar to a Value, but with some non-pure function (that need to be evaluated at execution time) in it.static classLists.Discarderstatic classLists.DiscarderByIndexstatic classLists.Literalstatic classLists.MarkerA marker for List values and IN relationsstatic classLists.Prependerstatic classLists.Setterstatic classLists.SetterByIndexstatic classLists.Value
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> AbstractType<?>getExactListTypeIfKnown(java.util.List<T> items, java.util.function.Function<T,AbstractType<?>> mapper)Returns the exact ListType from the items if it can be known.static ColumnSpecificationindexSpecOf(ColumnSpecification column)static <T> java.lang.StringlistToString(java.lang.Iterable<T> items, java.util.function.Function<T,java.lang.String> mapper)Create aStringrepresentation of the list from the specified items associated to the list elements.static java.lang.StringlistToString(java.util.List<?> elements)Create aStringrepresentation of the list containing the specified elements.static AssignmentTestable.TestResulttestListAssignment(ColumnSpecification receiver, java.util.List<? extends AssignmentTestable> elements)Tests that the list with the specified elements can be assigned to the specified column.static ColumnSpecificationvalueSpecOf(ColumnSpecification column)
-
-
-
Method Detail
-
indexSpecOf
public static ColumnSpecification indexSpecOf(ColumnSpecification column)
-
valueSpecOf
public static ColumnSpecification valueSpecOf(ColumnSpecification column)
-
testListAssignment
public static AssignmentTestable.TestResult testListAssignment(ColumnSpecification receiver, java.util.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
public static java.lang.String listToString(java.util.List<?> elements)
Create aStringrepresentation of the list containing the specified elements.- Parameters:
elements- the list elements- Returns:
- a
Stringrepresentation of the list
-
listToString
public static <T> java.lang.String listToString(java.lang.Iterable<T> items, java.util.function.Function<T,java.lang.String> mapper)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> AbstractType<?> getExactListTypeIfKnown(java.util.List<T> items, java.util.function.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
-
-