Class Maps

java.lang.Object
org.apache.cassandra.cql3.Maps

public abstract class Maps extends Object
Static helper methods and classes for maps.
  • Method Details

    • 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, List<Pair<T,T>> entries)
      Tests that the map with the specified entries can be assigned to the specified column.
      Parameters:
      receiver - the receiving column
      entries - the map entries
    • mapToString

      public static <T> String mapToString(List<Pair<T,T>> entries)
      Create a String representation of the list containing the specified elements.
      Parameters:
      entries - the list elements
      Returns:
      a String representation of the list
    • mapToString

      public static <T> String mapToString(List<Pair<T,T>> items, Function<T,String> mapper)
      Create a String representation of the map from the specified items associated to the map entries.
      Parameters:
      items - items associated to the map entries
      mapper - the mapper used to map the items to the String representation of the map entries
      Returns:
      a String representation 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 entries
      mapper - 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)