Class KeyspaceMetadata

  • All Implemented Interfaces:
    SchemaElement

    public final class KeyspaceMetadata
    extends java.lang.Object
    implements SchemaElement
    An immutable representation of keyspace metadata (name, params, tables, types, and functions).
    • Method Detail

      • isVirtual

        public boolean isVirtual()
      • withUpdatedUserType

        public KeyspaceMetadata withUpdatedUserType​(UserType udt)
        Returns a new KeyspaceMetadata with all instances of old UDT replaced with the updated version. Replaces all instances in tables, views, types, and functions.
      • tablesAndViews

        public java.lang.Iterable<TableMetadata> tablesAndViews()
      • getTableOrViewNullable

        @Nullable
        public TableMetadata getTableOrViewNullable​(java.lang.String tableOrViewName)
      • getTableNullable

        @Nullable
        public TableMetadata getTableNullable​(java.lang.String tableName)
      • hasTable

        public boolean hasTable​(java.lang.String tableName)
      • hasView

        public boolean hasView​(java.lang.String viewName)
      • hasIndex

        public boolean hasIndex​(java.lang.String indexName)
      • tablesUsingFunction

        public java.util.stream.Stream<TableMetadata> tablesUsingFunction​(Function function)
        Parameters:
        function - a user function
        Returns:
        a stream of tables within this keyspace that have column masks using the specified user function
      • findAvailableIndexName

        public java.lang.String findAvailableIndexName​(java.lang.String baseName)
      • findIndexedTable

        public java.util.Optional<TableMetadata> findIndexedTable​(java.lang.String indexName)
      • hashCode

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

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

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

        public java.lang.String elementKeyspace()
        Description copied from interface: SchemaElement
        Returns the CQL name of the keyspace to which this schema element belong.
        Specified by:
        elementKeyspace in interface SchemaElement
        Returns:
        the keyspace name.
      • elementName

        public java.lang.String elementName()
        Description copied from interface: SchemaElement
        Returns the CQL name of this schema element.
        Specified by:
        elementName in interface SchemaElement
        Returns:
        the name of this schema element.
      • toCqlString

        public java.lang.String toCqlString​(boolean withInternals,
                                            boolean ifNotExists)
        Description copied from interface: SchemaElement
        Returns a CQL representation of this element
        Specified by:
        toCqlString in interface SchemaElement
        Parameters:
        withInternals - if the internals part of the CQL should be exposed.
        ifNotExists - if "IF NOT EXISTS" should be included.
        Returns:
        a CQL representation of this element
      • validate

        public void validate()