Class Sets

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

public abstract class Sets extends Object
Static helper methods and classes for sets.
  • Method Details

    • valueSpecOf

      public static ColumnSpecification valueSpecOf(ColumnSpecification column)
    • testSetAssignment

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

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

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

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

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