Class Types

java.lang.Object
org.apache.cassandra.schema.Types
All Implemented Interfaces:
Iterable<UserType>

public final class Types extends Object implements Iterable<UserType>
An immutable container for a keyspace's UDTs.
  • Method Details

    • builder

      public static Types.Builder builder()
    • rawBuilder

      public static Types.RawBuilder rawBuilder(String keyspace)
    • none

      public static Types none()
    • of

      public static Types of(UserType... types)
    • iterator

      public Iterator<UserType> iterator()
      Specified by:
      iterator in interface Iterable<UserType>
    • stream

      public Stream<UserType> stream()
    • sortedStream

      public Stream<UserType> sortedStream()
      Returns a stream of user types sorted by dependencies
      Returns:
      a stream of user types sorted by dependencies
    • referencingUserType

      public Iterable<UserType> referencingUserType(ByteBuffer name)
    • isEmpty

      public boolean isEmpty()
    • get

      public Optional<UserType> get(ByteBuffer name)
      Get the type with the specified name
      Parameters:
      name - a non-qualified type name
      Returns:
      an empty Optional if the type name is not found; a non-empty optional of UserType otherwise
    • getNullable

      @Nullable public UserType getNullable(ByteBuffer name)
      Get the type with the specified name
      Parameters:
      name - a non-qualified type name
      Returns:
      null if the type name is not found; the found UserType otherwise
    • with

      public Types with(UserType type)
      Create a Types instance with the provided type added
    • without

      public Types without(ByteBuffer name)
      Creates a Types instance with the type with the provided name removed
    • without

      public Types without(UserType type)
    • withUpdatedUserType

      public Types withUpdatedUserType(UserType udt)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object