public interface Restriction
Implementation of this class must be immutable. See mergeWith(Restriction)
for more explanation.
Modifier and Type | Method and Description |
---|---|
void |
addFunctionsTo(java.util.List<Function> functions)
Adds all functions (native and user-defined) used by any component of the restriction
to the specified list.
|
void |
addRowFilterTo(RowFilter filter,
SecondaryIndexManager indexManager,
QueryOptions options)
Adds to the specified row filter the expressions corresponding to this
Restriction . |
MultiCBuilder |
appendBoundTo(MultiCBuilder builder,
Bound bound,
QueryOptions options)
Appends the values of the
Restriction for the specified bound to the specified builder. |
MultiCBuilder |
appendTo(MultiCBuilder builder,
QueryOptions options)
Appends the values of this
Restriction to the specified builder. |
java.util.List<ColumnDefinition> |
getColumnDefs()
Returns the column definitions in position order.
|
ColumnDefinition |
getFirstColumn()
Returns the definition of the first column.
|
ColumnDefinition |
getLastColumn()
Returns the definition of the last column.
|
boolean |
hasBound(Bound b)
Checks if the specified bound is set or not.
|
boolean |
hasSupportingIndex(SecondaryIndexManager indexManager)
Check if the restriction is on indexed columns.
|
boolean |
isContains() |
boolean |
isEQ() |
boolean |
isIN() |
boolean |
isInclusive(Bound b)
Checks if the specified bound is inclusive or not.
|
boolean |
isMultiColumn() |
boolean |
isNotNull() |
boolean |
isOnToken() |
boolean |
isSlice() |
Restriction |
mergeWith(Restriction otherRestriction)
Merges this restriction with the specified one.
|
boolean isOnToken()
boolean isSlice()
boolean isEQ()
boolean isIN()
boolean isContains()
boolean isNotNull()
boolean isMultiColumn()
ColumnDefinition getFirstColumn()
ColumnDefinition getLastColumn()
java.util.List<ColumnDefinition> getColumnDefs()
void addFunctionsTo(java.util.List<Function> functions)
functions
- the list to add toboolean hasBound(Bound b)
b
- the bound typetrue
if the specified bound is set, false
otherwiseboolean isInclusive(Bound b)
b
- the bound typetrue
if the specified bound is inclusive, false
otherwiseRestriction mergeWith(Restriction otherRestriction) throws InvalidRequestException
Restriction are immutable. Therefore merging two restrictions result in a new one. The reason behind this choice is that it allow a great flexibility in the way the merging can done while preventing any side effect.
otherRestriction
- the restriction to merge into this oneInvalidRequestException
- if the restrictions cannot be mergedboolean hasSupportingIndex(SecondaryIndexManager indexManager)
indexManager
- the index managertrue
if the restriction is on indexed columns, false
void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options) throws InvalidRequestException
Restriction
.filter
- the row filter to add expressions toindexManager
- the secondary index manageroptions
- the query optionsInvalidRequestException
- if this Restriction
cannot be converted into a row filterMultiCBuilder appendTo(MultiCBuilder builder, QueryOptions options)
Restriction
to the specified builder.builder
- the MultiCBuilder
to append to.options
- the query optionsMultiCBuilder
MultiCBuilder appendBoundTo(MultiCBuilder builder, Bound bound, QueryOptions options)
Restriction
for the specified bound to the specified builder.builder
- the MultiCBuilder
to append to.bound
- the boundoptions
- the query optionsMultiCBuilder
Copyright © 2017 The Apache Software Foundation