Class Keyspaces

  • All Implemented Interfaces:
    java.lang.Iterable<KeyspaceMetadata>

    public final class Keyspaces
    extends java.lang.Object
    implements java.lang.Iterable<KeyspaceMetadata>
    • Method Detail

      • names

        public com.google.common.collect.ImmutableSet<java.lang.String> names()
      • get

        public java.util.Optional<KeyspaceMetadata> get​(java.lang.String name)
        Get the keyspace with the specified name
        Parameters:
        name - a non-qualified keyspace name
        Returns:
        an empty Optional if the table name is not found; a non-empty optional of KeyspaceMetadata otherwise
      • getNullable

        @Nullable
        public KeyspaceMetadata getNullable​(java.lang.String name)
      • containsKeyspace

        public boolean containsKeyspace​(java.lang.String name)
      • isEmpty

        public boolean isEmpty()
      • without

        public Keyspaces without​(java.lang.String name)
        Creates a Keyspaces instance with the keyspace with the provided name removed
      • without

        public Keyspaces without​(java.util.Collection<java.lang.String> names)
      • withAddedOrReplaced

        public Keyspaces withAddedOrReplaced​(KeyspaceMetadata keyspace)
        Returns a new Keyspaces equivalent to this one, but with the provided keyspace metadata either added (if this Keyspaces does not have that keyspace), or replaced by the provided definition.

        Note that if this contains the provided keyspace, its pre-existing definition is discarded and completely replaced with the newly provided one. See withAddedOrUpdated(KeyspaceMetadata) if you wish the provided definition to be "merged" with the existing one instead.

        Parameters:
        keyspace - the keyspace metadata to add, or replace the existing definition with.
        Returns:
        the newly created object.
      • validate

        public void validate()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • size

        public int size()