Class Lists

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

public abstract class Lists extends Object
Static helper methods and classes for lists.
  • Method Details

    • indexSpecOf

      public static ColumnSpecification indexSpecOf(ColumnSpecification column)
    • valueSpecOf

      public static ColumnSpecification valueSpecOf(ColumnSpecification column)
    • testListAssignment

      public static AssignmentTestable.TestResult testListAssignment(ColumnSpecification receiver, List<? extends AssignmentTestable> elements)
      Tests that the list with the specified elements can be assigned to the specified column.
      Parameters:
      receiver - the receiving column
      elements - the list elements
    • listToString

      public static String listToString(List<?> elements)
      Create a String representation of the list containing the specified elements.
      Parameters:
      elements - the list elements
      Returns:
      a String representation of the list
    • listToString

      public static <T> String listToString(Iterable<T> items, Function<T,String> mapper)
      Create a String representation of the list from the specified items associated to the list elements.
      Parameters:
      items - items associated to the list elements
      mapper - the mapper used to map the items to the String representation of the list elements
      Returns:
      a String representation of the list
    • getExactListTypeIfKnown

      public static <T> ListType<?> getExactListTypeIfKnown(List<T> items, Function<T,AbstractType<?>> mapper)
      Returns the exact ListType from the items if it can be known.
      Parameters:
      items - the items mapped to the list elements
      mapper - the mapper used to retrieve the element types from the items
      Returns:
      the exact ListType from the items if it can be known or null
    • getPreferredCompatibleType

      public static <T> ListType<?> getPreferredCompatibleType(List<T> items, Function<T,AbstractType<?>> mapper)