Package org.apache.cassandra.cql3
Class Maps
- java.lang.Object
-
- org.apache.cassandra.cql3.Maps
-
public abstract class Maps extends java.lang.Object
Static helper methods and classes for maps.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Maps.DelayedValue
static class
Maps.DiscarderByKey
static class
Maps.Literal
static class
Maps.Marker
static class
Maps.Putter
static class
Maps.Setter
static class
Maps.SetterByKey
static class
Maps.Value
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> MapType<?,?>
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 <T> MapType<?,?>
getPreferredCompatibleType(java.util.List<Pair<T,T>> entries, java.util.function.Function<T,AbstractType<?>> mapper)
static ColumnSpecification
keySpecOf(ColumnSpecification column)
static <T> java.lang.String
mapToString(java.util.List<Pair<T,T>> entries)
Create aString
representation of the list containing the specified elements.static <T> java.lang.String
mapToString(java.util.List<Pair<T,T>> items, java.util.function.Function<T,java.lang.String> mapper)
Create aString
representation 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 ColumnSpecification
valueSpecOf(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 aString
representation of the list containing the specified elements.- Parameters:
entries
- the list elements- Returns:
- a
String
representation 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 aString
representation 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 theString
representation of the map entries- Returns:
- a
String
representation of the map
-
getExactMapTypeIfKnown
public static <T> MapType<?,?> 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
-
getPreferredCompatibleType
public static <T> MapType<?,?> getPreferredCompatibleType(java.util.List<Pair<T,T>> entries, java.util.function.Function<T,AbstractType<?>> mapper)
-
-