Package org.apache.cassandra.cql3
Class Sets
java.lang.Object
org.apache.cassandra.cql3.Sets
Static helper methods and classes for sets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> SetType<?>getExactSetTypeIfKnown(List<T> items, Function<T, AbstractType<?>> mapper) Returns the exact SetType from the items if it can be known.static <T> SetType<?>getPreferredCompatibleType(List<T> items, Function<T, AbstractType<?>> mapper) static <T> StringsetToString(Iterable<T> items, Function<T, String> mapper) Create aStringrepresentation of the set from the specified items associated to the set elements.static StringsetToString(List<?> elements) Create aStringrepresentation of the set containing the specified elements.testSetAssignment(ColumnSpecification receiver, List<? extends AssignmentTestable> elements) Tests that the set with the specified elements can be assigned to the specified column.static ColumnSpecificationvalueSpecOf(ColumnSpecification column)
-
Method Details
-
valueSpecOf
-
testSetAssignment
public static AssignmentTestable.TestResult testSetAssignment(ColumnSpecification receiver, 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
Create aStringrepresentation of the set containing the specified elements.- Parameters:
elements- the set elements- Returns:
- a
Stringrepresentation of the set
-
setToString
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> SetType<?> getExactSetTypeIfKnown(List<T> items, 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
-
getPreferredCompatibleType
public static <T> SetType<?> getPreferredCompatibleType(List<T> items, Function<T, AbstractType<?>> mapper)
-