Package org.apache.cassandra.schema
Class Views
- java.lang.Object
-
- org.apache.cassandra.schema.Views
-
- All Implemented Interfaces:
java.lang.Iterable<ViewMetadata>
public final class Views extends java.lang.Object implements java.lang.Iterable<ViewMetadata>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Views.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Views.Builder
builder()
boolean
equals(java.lang.Object o)
java.lang.Iterable<ViewMetadata>
forTable(TableId tableId)
java.util.Optional<ViewMetadata>
get(java.lang.String name)
Get the materialized view with the specified nameViewMetadata
getNullable(java.lang.String name)
Get the view with the specified nameint
hashCode()
boolean
isEmpty()
java.util.Iterator<ViewMetadata>
iterator()
static Views
none()
int
size()
java.util.stream.Stream<ViewMetadata>
stream()
java.util.stream.Stream<ViewMetadata>
stream(TableId tableId)
java.lang.String
toString()
Views.Builder
unbuild()
Views
with(ViewMetadata view)
Create a MaterializedViews instance with the provided materialized view addedViews
without(java.lang.String name)
Creates a MaterializedViews instance with the materializedView with the provided name removedViews
withSwapped(ViewMetadata view)
-
-
-
Method Detail
-
builder
public static Views.Builder builder()
-
unbuild
public Views.Builder unbuild()
-
none
public static Views none()
-
iterator
public java.util.Iterator<ViewMetadata> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<ViewMetadata>
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
forTable
public java.lang.Iterable<ViewMetadata> forTable(TableId tableId)
-
stream
public java.util.stream.Stream<ViewMetadata> stream()
-
stream
public java.util.stream.Stream<ViewMetadata> stream(TableId tableId)
-
get
public java.util.Optional<ViewMetadata> get(java.lang.String name)
Get the materialized view with the specified name- Parameters:
name
- a non-qualified materialized view name- Returns:
- an empty
Optional
if the materialized view name is not found; a non-empty optional ofViewMetadata
otherwise
-
getNullable
@Nullable public ViewMetadata getNullable(java.lang.String name)
Get the view with the specified name- Parameters:
name
- a non-qualified view name- Returns:
- null if the view name is not found; the found
ViewMetadata
otherwise
-
with
public Views with(ViewMetadata view)
Create a MaterializedViews instance with the provided materialized view added
-
withSwapped
public Views withSwapped(ViewMetadata view)
-
without
public Views without(java.lang.String name)
Creates a MaterializedViews instance with the materializedView with the provided name removed
-
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
-
-