Package org.apache.cassandra.cql3
Class Lists
- java.lang.Object
-
- org.apache.cassandra.cql3.Lists
-
public abstract class Lists extends java.lang.Object
Static helper methods and classes for lists.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Lists.Appender
static class
Lists.DelayedValue
Basically similar to a Value, but with some non-pure function (that need to be evaluated at execution time) in it.static class
Lists.Discarder
static class
Lists.DiscarderByIndex
static class
Lists.Literal
static class
Lists.Marker
A marker for List values and IN relationsstatic class
Lists.Prepender
static class
Lists.Setter
static class
Lists.SetterByIndex
static class
Lists.Value
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ListType<?>
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 <T> ListType<?>
getPreferredCompatibleType(java.util.List<T> items, java.util.function.Function<T,AbstractType<?>> mapper)
static ColumnSpecification
indexSpecOf(ColumnSpecification column)
static <T> java.lang.String
listToString(java.lang.Iterable<T> items, java.util.function.Function<T,java.lang.String> mapper)
Create aString
representation of the list from the specified items associated to the list elements.static java.lang.String
listToString(java.util.List<?> elements)
Create aString
representation of the list containing the specified elements.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.static ColumnSpecification
valueSpecOf(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 aString
representation of the list containing the specified elements.- Parameters:
elements
- the list elements- Returns:
- a
String
representation 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 aString
representation 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 theString
representation of the list elements- Returns:
- a
String
representation of the list
-
getExactListTypeIfKnown
public static <T> ListType<?> 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
-
getPreferredCompatibleType
public static <T> ListType<?> getPreferredCompatibleType(java.util.List<T> items, java.util.function.Function<T,AbstractType<?>> mapper)
-
-