Package org.apache.cassandra.cql3
Class Maps
- java.lang.Object
-
- org.apache.cassandra.cql3.Maps
-
public abstract class Maps extends java.lang.ObjectStatic helper methods and classes for maps.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMaps.DelayedValuestatic classMaps.DiscarderByKeystatic classMaps.Literalstatic classMaps.Markerstatic classMaps.Putterstatic classMaps.Setterstatic classMaps.SetterByKeystatic classMaps.Value
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> AbstractType<?>getExactMapTypeIfKnown(java.util.List<Pair<T,T>> entries, java.util.function.Function<T,AbstractType<?>> mapper)Returns the exact MapType from the entries if it can be known.static ColumnSpecificationkeySpecOf(ColumnSpecification column)static <T> java.lang.StringmapToString(java.util.List<Pair<T,T>> entries)Create aStringrepresentation of the list containing the specified elements.static <T> java.lang.StringmapToString(java.util.List<Pair<T,T>> items, java.util.function.Function<T,java.lang.String> mapper)Create aStringrepresentation of the map from the specified items associated to the map entries.static <T extends AssignmentTestable>
AssignmentTestable.TestResulttestMapAssignment(ColumnSpecification receiver, java.util.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 Detail
-
keySpecOf
public static ColumnSpecification keySpecOf(ColumnSpecification column)
-
valueSpecOf
public static ColumnSpecification valueSpecOf(ColumnSpecification column)
-
testMapAssignment
public static <T extends AssignmentTestable> AssignmentTestable.TestResult testMapAssignment(ColumnSpecification receiver, java.util.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
public static <T> java.lang.String mapToString(java.util.List<Pair<T,T>> entries)
Create aStringrepresentation of the list containing the specified elements.- Parameters:
entries- the list elements- Returns:
- a
Stringrepresentation of the list
-
mapToString
public static <T> java.lang.String mapToString(java.util.List<Pair<T,T>> items, java.util.function.Function<T,java.lang.String> mapper)
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> AbstractType<?> getExactMapTypeIfKnown(java.util.List<Pair<T,T>> entries, java.util.function.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
-
-