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 classTables.Builderstatic classTables.TablesDiff
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Tables.Builderbuilder()booleanequals(java.lang.Object o)Tablesfilter(java.util.function.Predicate<TableMetadata> predicate)java.util.Optional<TableMetadata>get(java.lang.String name)Get the table with the specified nameTableMetadatagetNullable(java.lang.String name)Get the table with the specified nameinthashCode()java.util.Iterator<TableMetadata>iterator()static Tablesnone()static Tablesof(java.lang.Iterable<TableMetadata> tables)static Tablesof(TableMetadata... tables)java.lang.Iterable<TableMetadata>referencingUserType(java.nio.ByteBuffer name)intsize()java.util.stream.Stream<TableMetadata>stream()java.lang.StringtoString()Tableswith(TableMetadata table)Create a Tables instance with the provided table addedTableswithout(java.lang.String name)Creates a Tables instance with the table with the provided name removedTableswithout(TableMetadata table)TableswithSwapped(TableMetadata table)TableswithUpdatedUserType(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:
iteratorin 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
Optionalif the table name is not found; a non-empty optional ofTableMetadataRefotherwise
-
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
TableMetadataRefotherwise
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-