Interface Restrictions
-
- All Superinterfaces:
Restriction
- All Known Implementing Classes:
TokenRestriction
,TokenRestriction.EQRestriction
,TokenRestriction.SliceRestriction
public interface Restrictions extends Restriction
Sets of restrictions
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Collection<ColumnMetadata>
getColumnDefinitions()
This method exists in addition toRestriction.getColumnDefs()
in case implementations want to provide columns definitions that are not strictly in position order.java.util.Set<Restriction>
getRestrictions(ColumnMetadata columnDef)
Returns the restrictions applied to the specified column.boolean
hasContains()
Checks if any of the underlying restrictions is a CONTAINS / CONTAINS KEY restriction.boolean
hasIN()
Checks if any of the underlying restriction is an IN.boolean
hasOnlyEqualityRestrictions()
Checks if all of the underlying restrictions are EQ or IN restrictions.boolean
hasSlice()
Checks if any of the underlying restrictions is a slice.boolean
isEmpty()
Checks if thisRestrictions
is empty or not.int
size()
Returns the number of columns that have a restriction.-
Methods inherited from interface org.apache.cassandra.cql3.restrictions.Restriction
addFunctionsTo, addToRowFilter, getColumnDefs, getFirstColumn, getLastColumn, hasSupportingIndex, isOnToken, needsFiltering
-
-
-
-
Method Detail
-
getRestrictions
java.util.Set<Restriction> getRestrictions(ColumnMetadata columnDef)
Returns the restrictions applied to the specified column.- Parameters:
columnDef
- the column definition- Returns:
- the restrictions applied to the specified column
-
getColumnDefinitions
default java.util.Collection<ColumnMetadata> getColumnDefinitions()
This method exists in addition toRestriction.getColumnDefs()
in case implementations want to provide columns definitions that are not strictly in position order.
-
isEmpty
boolean isEmpty()
Checks if thisRestrictions
is empty or not.- Returns:
true
if thisRestrictions
is empty,false
otherwise.
-
size
int size()
Returns the number of columns that have a restriction.- Returns:
- the number of columns that have a restriction.
-
hasIN
boolean hasIN()
Checks if any of the underlying restriction is an IN.- Returns:
true
if any of the underlying restriction is an IN,false
otherwise
-
hasContains
boolean hasContains()
Checks if any of the underlying restrictions is a CONTAINS / CONTAINS KEY restriction.- Returns:
true
if any of the underlying restrictions is CONTAINS,false
otherwise
-
hasSlice
boolean hasSlice()
Checks if any of the underlying restrictions is a slice.- Returns:
true
if any of the underlying restrictions is a slice,false
otherwise
-
hasOnlyEqualityRestrictions
boolean hasOnlyEqualityRestrictions()
Checks if all of the underlying restrictions are EQ or IN restrictions.- Returns:
true
if all of the underlying restrictions are EQ or IN restrictions,false
otherwise
-
-