Package org.apache.cassandra.schema
Class Keyspaces
java.lang.Object
org.apache.cassandra.schema.Keyspaces
- All Implemented Interfaces:
Iterable<KeyspaceMetadata>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Method Summary
Modifier and TypeMethodDescriptionstatic Keyspaces.Builderbuilder()booleancontainsKeyspace(String name) static Keyspaces.KeyspacesDiffbooleanfilter(Predicate<KeyspaceMetadata> predicate) Get the keyspace with the specified namegetNullable(String name) inthashCode()booleanisEmpty()iterator()com.google.common.collect.ImmutableSet<String>names()static Keyspacesnone()static Keyspacesof(KeyspaceMetadata... keyspaces) intsize()stream()toString()voidvalidate()withAddedOrReplaced(KeyspaceMetadata keyspace) withAddedOrReplaced(Keyspaces keyspaces) CallswithAddedOrReplaced(KeyspaceMetadata)on all the keyspaces of the providedKeyspaces.withAddedOrUpdated(KeyspaceMetadata keyspace) Creates a Keyspaces instance with the keyspace with the provided name removedwithout(Collection<String> names) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
builder
-
none
-
of
-
iterator
- Specified by:
iteratorin interfaceIterable<KeyspaceMetadata>
-
stream
-
names
-
get
Get the keyspace with the specified name- Parameters:
name- a non-qualified keyspace name- Returns:
- an empty
Optionalif the table name is not found; a non-empty optional ofKeyspaceMetadataotherwise
-
getNullable
-
containsKeyspace
-
getTableOrViewNullable
-
isEmpty
public boolean isEmpty() -
filter
-
without
Creates a Keyspaces instance with the keyspace with the provided name removed -
without
-
withAddedOrUpdated
-
withAddedOrReplaced
Returns a newKeyspacesequivalent to this one, but with the provided keyspace metadata either added (if thisKeyspacesdoes 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.
-
withAddedOrReplaced
CallswithAddedOrReplaced(KeyspaceMetadata)on all the keyspaces of the providedKeyspaces.- Parameters:
keyspaces- the keyspaces to add, or replace if existing.- Returns:
- the newly created object.
-
validate
public void validate() -
equals
-
hashCode
public int hashCode() -
toString
-
size
public int size() -
diff
-