Package org.apache.cassandra.cql3
Class Sets
- java.lang.Object
-
- org.apache.cassandra.cql3.Sets
-
public abstract class Sets extends java.lang.Object
Static helper methods and classes for sets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sets.Adder
static class
Sets.DelayedValue
static class
Sets.Discarder
static class
Sets.ElementDiscarder
static class
Sets.Literal
static class
Sets.Marker
static class
Sets.Setter
static class
Sets.Value
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> SetType<?>
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> SetType<?>
getPreferredCompatibleType(java.util.List<T> items, java.util.function.Function<T,AbstractType<?>> mapper)
static <T> java.lang.String
setToString(java.lang.Iterable<T> items, java.util.function.Function<T,java.lang.String> mapper)
Create aString
representation of the set from the specified items associated to the set elements.static java.lang.String
setToString(java.util.List<?> elements)
Create aString
representation of the set containing the specified elements.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.static ColumnSpecification
valueSpecOf(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 aString
representation of the set containing the specified elements.- Parameters:
elements
- the set elements- Returns:
- a
String
representation 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 aString
representation 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 theString
representation of the set elements- Returns:
- a
String
representation of the set
-
getExactSetTypeIfKnown
public static <T> SetType<?> 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
-
getPreferredCompatibleType
public static <T> SetType<?> getPreferredCompatibleType(java.util.List<T> items, java.util.function.Function<T,AbstractType<?>> mapper)
-
-