Package org.apache.cassandra.cql3
Class Sets
- java.lang.Object
-
- org.apache.cassandra.cql3.Sets
-
public abstract class Sets extends java.lang.ObjectStatic helper methods and classes for sets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSets.Adderstatic classSets.DelayedValuestatic classSets.Discarderstatic classSets.ElementDiscarderstatic classSets.Literalstatic classSets.Markerstatic classSets.Setterstatic classSets.Value
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> AbstractType<?>getExactSetTypeIfKnown(java.util.List<T> items, java.util.function.Function<T,AbstractType<?>> mapper)Returns the exact SetType from the items if it can be known.static <T> java.lang.StringsetToString(java.lang.Iterable<T> items, java.util.function.Function<T,java.lang.String> mapper)Create aStringrepresentation of the set from the specified items associated to the set elements.static java.lang.StringsetToString(java.util.List<?> elements)Create aStringrepresentation of the set containing the specified elements.static AssignmentTestable.TestResulttestSetAssignment(ColumnSpecification receiver, java.util.List<? extends AssignmentTestable> elements)Tests that the set with the specified elements can be assigned to the specified column.static ColumnSpecificationvalueSpecOf(ColumnSpecification column)
-
-
-
Method Detail
-
valueSpecOf
public static ColumnSpecification valueSpecOf(ColumnSpecification column)
-
testSetAssignment
public static AssignmentTestable.TestResult testSetAssignment(ColumnSpecification receiver, java.util.List<? extends AssignmentTestable> elements)
Tests that the set with the specified elements can be assigned to the specified column.- Parameters:
receiver- the receiving columnelements- the set elements
-
setToString
public static java.lang.String setToString(java.util.List<?> elements)
Create aStringrepresentation of the set containing the specified elements.- Parameters:
elements- the set elements- Returns:
- a
Stringrepresentation of the set
-
setToString
public static <T> java.lang.String setToString(java.lang.Iterable<T> items, java.util.function.Function<T,java.lang.String> mapper)Create aStringrepresentation of the set from the specified items associated to the set elements.- Parameters:
items- items associated to the set elementsmapper- the mapper used to map the items to theStringrepresentation of the set elements- Returns:
- a
Stringrepresentation of the set
-
getExactSetTypeIfKnown
public static <T> AbstractType<?> getExactSetTypeIfKnown(java.util.List<T> items, java.util.function.Function<T,AbstractType<?>> mapper)
Returns the exact SetType from the items if it can be known.- Parameters:
items- the items mapped to the set elementsmapper- the mapper used to retrieve the element types from the items- Returns:
- the exact SetType from the items if it can be known or
null
-
-