Package org.apache.cassandra.cql3
Class Maps
java.lang.Object
org.apache.cassandra.cql3.Maps
Static helper methods and classes for maps.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> MapType<?,?> getExactMapTypeIfKnown(List<Pair<T, T>> entries, Function<T, AbstractType<?>> mapper) Returns the exact MapType from the entries if it can be known.static <T> MapType<?,?> getPreferredCompatibleType(List<Pair<T, T>> entries, Function<T, AbstractType<?>> mapper) static ColumnSpecificationkeySpecOf(ColumnSpecification column) static <T> StringmapToString(List<Pair<T, T>> entries) Create aStringrepresentation of the list containing the specified elements.static <T> StringmapToString(List<Pair<T, T>> items, Function<T, String> mapper) Create aStringrepresentation of the map from the specified items associated to the map entries.static <T extends AssignmentTestable>
AssignmentTestable.TestResulttestMapAssignment(ColumnSpecification receiver, List<Pair<T, T>> entries) Tests that the map with the specified entries can be assigned to the specified column.static ColumnSpecificationvalueSpecOf(ColumnSpecification column)
-
Method Details
-
keySpecOf
-
valueSpecOf
-
testMapAssignment
public static <T extends AssignmentTestable> AssignmentTestable.TestResult testMapAssignment(ColumnSpecification receiver, List<Pair<T, T>> entries) Tests that the map with the specified entries can be assigned to the specified column.- Parameters:
receiver- the receiving columnentries- the map entries
-
mapToString
Create aStringrepresentation of the list containing the specified elements.- Parameters:
entries- the list elements- Returns:
- a
Stringrepresentation of the list
-
mapToString
Create aStringrepresentation of the map from the specified items associated to the map entries.- Parameters:
items- items associated to the map entriesmapper- the mapper used to map the items to theStringrepresentation of the map entries- Returns:
- a
Stringrepresentation of the map
-
getExactMapTypeIfKnown
public static <T> MapType<?,?> getExactMapTypeIfKnown(List<Pair<T, T>> entries, Function<T, AbstractType<?>> mapper) Returns the exact MapType from the entries if it can be known.- Parameters:
entries- the entriesmapper- the mapper used to retrieve the key and value types from the entries- Returns:
- the exact MapType from the entries if it can be known or
null
-
getPreferredCompatibleType
public static <T> MapType<?,?> getPreferredCompatibleType(List<Pair<T, T>> entries, Function<T, AbstractType<?>> mapper)
-