Package org.apache.cassandra.schema
Class Tables
- java.lang.Object
-
- org.apache.cassandra.schema.Tables
-
- All Implemented Interfaces:
java.lang.Iterable<TableMetadata>
public final class Tables extends java.lang.Object implements java.lang.Iterable<TableMetadata>
An immutable container for a keyspace's Tables.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Tables.Builder
static class
Tables.TablesDiff
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Tables.Builder
builder()
boolean
equals(java.lang.Object o)
Tables
filter(java.util.function.Predicate<TableMetadata> predicate)
java.util.Optional<TableMetadata>
get(java.lang.String name)
Get the table with the specified nameTableMetadata
getNullable(java.lang.String name)
Get the table with the specified nameTableMetadata
getNullable(TableId id)
int
hashCode()
java.util.Iterator<TableMetadata>
iterator()
static Tables
none()
static Tables
of(java.lang.Iterable<TableMetadata> tables)
static Tables
of(TableMetadata... tables)
java.lang.Iterable<TableMetadata>
referencingUserType(java.nio.ByteBuffer name)
int
size()
java.util.stream.Stream<TableMetadata>
stream()
java.lang.String
toString()
Tables
with(TableMetadata table)
Create a Tables instance with the provided table addedTables
without(java.lang.String name)
Creates a Tables instance with the table with the provided name removedTables
without(TableMetadata table)
Tables
withSwapped(TableMetadata table)
Tables
withUpdatedUserType(UserType udt)
-
-
-
Method Detail
-
builder
public static Tables.Builder builder()
-
none
public static Tables none()
-
of
public static Tables of(TableMetadata... tables)
-
of
public static Tables of(java.lang.Iterable<TableMetadata> tables)
-
iterator
public java.util.Iterator<TableMetadata> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<TableMetadata>
-
stream
public java.util.stream.Stream<TableMetadata> stream()
-
referencingUserType
public java.lang.Iterable<TableMetadata> referencingUserType(java.nio.ByteBuffer name)
-
size
public int size()
-
get
public java.util.Optional<TableMetadata> get(java.lang.String name)
Get the table with the specified name- Parameters:
name
- a non-qualified table name- Returns:
- an empty
Optional
if the table name is not found; a non-empty optional ofTableMetadataRef
otherwise
-
getNullable
@Nullable public TableMetadata getNullable(java.lang.String name)
Get the table with the specified name- Parameters:
name
- a non-qualified table name- Returns:
- null if the table name is not found; the found
TableMetadataRef
otherwise
-
getNullable
@Nullable public TableMetadata getNullable(TableId id)
-
filter
public Tables filter(java.util.function.Predicate<TableMetadata> predicate)
-
with
public Tables with(TableMetadata table)
Create a Tables instance with the provided table added
-
withSwapped
public Tables withSwapped(TableMetadata table)
-
without
public Tables without(java.lang.String name)
Creates a Tables instance with the table with the provided name removed
-
without
public Tables without(TableMetadata table)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-