public final class Keyspaces extends java.lang.Object implements java.lang.Iterable<KeyspaceMetadata>
Modifier and Type | Class and Description |
---|---|
static class |
Keyspaces.Builder |
static class |
Keyspaces.KeyspacesDiff |
Modifier and Type | Method and Description |
---|---|
static Keyspaces.Builder |
builder() |
boolean |
containsKeyspace(java.lang.String name) |
static Keyspaces.KeyspacesDiff |
diff(Keyspaces before,
Keyspaces after) |
boolean |
equals(java.lang.Object o) |
Keyspaces |
filter(java.util.function.Predicate<KeyspaceMetadata> predicate) |
java.util.Optional<KeyspaceMetadata> |
get(java.lang.String name)
Get the keyspace with the specified name
|
KeyspaceMetadata |
getNullable(java.lang.String name) |
TableMetadata |
getTableOrViewNullable(TableId id) |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<KeyspaceMetadata> |
iterator() |
com.google.common.collect.ImmutableSet<java.lang.String> |
names() |
static Keyspaces |
none() |
static Keyspaces |
of(KeyspaceMetadata... keyspaces) |
int |
size() |
java.util.stream.Stream<KeyspaceMetadata> |
stream() |
java.lang.String |
toString() |
void |
validate() |
Keyspaces |
withAddedOrReplaced(KeyspaceMetadata keyspace)
|
Keyspaces |
withAddedOrReplaced(Keyspaces keyspaces)
Calls
withAddedOrReplaced(KeyspaceMetadata) on all the keyspaces of the provided Keyspaces . |
Keyspaces |
withAddedOrUpdated(KeyspaceMetadata keyspace) |
Keyspaces |
without(java.util.Collection<java.lang.String> names) |
Keyspaces |
without(java.lang.String name)
Creates a Keyspaces instance with the keyspace with the provided name removed
|
public static Keyspaces.Builder builder()
public static Keyspaces none()
public static Keyspaces of(KeyspaceMetadata... keyspaces)
public java.util.Iterator<KeyspaceMetadata> iterator()
iterator
in interface java.lang.Iterable<KeyspaceMetadata>
public java.util.stream.Stream<KeyspaceMetadata> stream()
public com.google.common.collect.ImmutableSet<java.lang.String> names()
public java.util.Optional<KeyspaceMetadata> get(java.lang.String name)
name
- a non-qualified keyspace nameOptional
if the table name is not found; a non-empty optional of KeyspaceMetadata
otherwise@Nullable public KeyspaceMetadata getNullable(java.lang.String name)
public boolean containsKeyspace(java.lang.String name)
@Nullable public TableMetadata getTableOrViewNullable(TableId id)
public boolean isEmpty()
public Keyspaces filter(java.util.function.Predicate<KeyspaceMetadata> predicate)
public Keyspaces without(java.lang.String name)
public Keyspaces without(java.util.Collection<java.lang.String> names)
public Keyspaces withAddedOrUpdated(KeyspaceMetadata keyspace)
public Keyspaces withAddedOrReplaced(KeyspaceMetadata keyspace)
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.
keyspace
- the keyspace metadata to add, or replace the existing definition with.public Keyspaces withAddedOrReplaced(Keyspaces keyspaces)
withAddedOrReplaced(KeyspaceMetadata)
on all the keyspaces of the provided Keyspaces
.keyspaces
- the keyspaces to add, or replace if existing.public void validate()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int size()
public static Keyspaces.KeyspacesDiff diff(Keyspaces before, Keyspaces after)
Copyright © 2009-2022 The Apache Software Foundation