SingleColumnRestriction.Contains (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.cql3.restrictions

## Class SingleColumnRestriction.Contains

- java.lang.Object
- - org.apache.cassandra.cql3.restrictions.SingleColumnRestriction
  - - org.apache.cassandra.cql3.restrictions.SingleColumnRestriction.Contains

- All Implemented Interfaces:
    Restriction
  Enclosing class:
    SingleColumnRestriction

      public static final class SingleColumnRestriction.Contains
      extends SingleColumnRestriction

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.cql3.restrictions.SingleColumnRestriction

      `SingleColumnRestriction.Contains, SingleColumnRestriction.EQ, SingleColumnRestriction.IN, SingleColumnRestriction.InWithMarker, SingleColumnRestriction.InWithValues, SingleColumnRestriction.Slice`

  - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.cql3.restrictions.SingleColumnRestriction

      `columnDef`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Contains(ColumnDefinition columnDef, Term t, boolean isKey)`
    `Contains(ColumnDefinition columnDef, Term mapKey, Term mapValue)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addIndexExpressionTo(java.util.List<IndexExpression> expressions, SecondaryIndexManager indexManager, QueryOptions options)` Adds to the specified list the `IndexExpression`s corresponding to this `Restriction`.
    `CompositesBuilder` | `appendBoundTo(CFMetaData cfm, CompositesBuilder builder, Bound bound, QueryOptions options)` Appends the values of the `Restriction` for the specified bound to the specified builder.
    `CompositesBuilder` | `appendTo(CFMetaData cfm, CompositesBuilder builder, QueryOptions options)` Appends the values of this `Restriction` to the specified builder.
    `Restriction` | `doMergeWith(Restriction otherRestriction)`
    `java.lang.Iterable<Function>` | `getFunctions()` Return an Iterable over all of the functions (both native and user-defined) used by any component of the restriction
    `boolean` | `hasBound(Bound b)` Checks if the specified bound is set or not.
    `boolean` | `isContains()`
    `boolean` | `isEQ()`
    `boolean` | `isIN()`
    `boolean` | `isInclusive(Bound b)` Checks if the specified bound is inclusive or not.
    `boolean` | `isMultiColumn()`
    `boolean` | `isNotReturningAnyRows(CFMetaData cfm, QueryOptions options)` Checks if this restriction will prevent the query to return any rows.
    `boolean` | `isOnToken()`
    `boolean` | `isSlice()`
    `protected boolean` | `isSupportedBy(SecondaryIndex index)` Check if this type of restriction is supported by the specified index.
    `int` | `numberOfEntries()`
    `int` | `numberOfKeys()`
    `int` | `numberOfValues()`
    `protected static Bound` | `reverseBoundIfNeeded(ColumnDefinition columnDefinition, Bound bound)` Reverses the specified bound if the column type is a reversed one.
    `java.lang.String` | `toString()`
    `protected static java.nio.ByteBuffer` | `validateIndexedValue(ColumnSpecification columnSpec, java.nio.ByteBuffer value)`

    - ### Methods inherited from class org.apache.cassandra.cql3.restrictions.SingleColumnRestriction

      `getColumnDefs, getFirstColumn, getLastColumn, hasSupportingIndex, mergeWith`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Contains

          public Contains(ColumnDefinition columnDef,
                          Term t,
                          boolean isKey)

    - #### Contains

          public Contains(ColumnDefinition columnDef,
                          Term mapKey,
                          Term mapValue)

  - ### Method Detail

    - #### appendTo

          public CompositesBuilder appendTo(CFMetaData cfm,
                                            CompositesBuilder builder,
                                            QueryOptions options)

      Description copied from interface: `Restriction`
      Appends the values of this `Restriction` to the specified builder.
      Parameters:
        `cfm` - the table metadata
        `builder` - the `CompositesBuilder` to append to.
        `options` - the query options
      Returns:
        the `CompositesBuilder`

    - #### isContains

          public boolean isContains()

      Specified by:
        `isContains` in interface `Restriction`

    - #### doMergeWith

          public Restriction doMergeWith(Restriction otherRestriction)
                                  throws InvalidRequestException

      Specified by:
        `doMergeWith` in class `SingleColumnRestriction`
      Throws:
        `InvalidRequestException`

    - #### addIndexExpressionTo

          public void addIndexExpressionTo(java.util.List<IndexExpression> expressions,
                                           SecondaryIndexManager indexManager,
                                           QueryOptions options)
                                    throws InvalidRequestException

      Description copied from interface: `Restriction`
      Adds to the specified list the `IndexExpression`s corresponding to this `Restriction`.
      Parameters:
        `expressions` - the list to add the `IndexExpression`s to
        `indexManager` - the secondary index manager
        `options` - the query options
      Throws:
        `InvalidRequestException` - if this `Restriction` cannot be converted into `IndexExpression`s

    - #### isSupportedBy

          protected boolean isSupportedBy(SecondaryIndex index)

      Description copied from class: `SingleColumnRestriction`
      Check if this type of restriction is supported by the specified index.
      Specified by:
        `isSupportedBy` in class `SingleColumnRestriction`
      Parameters:
        `index` - the Secondary index
      Returns:
        `true` this type of restriction is supported by the specified index, `false` otherwise.

    - #### numberOfValues

          public int numberOfValues()

    - #### numberOfKeys

          public int numberOfKeys()

    - #### numberOfEntries

          public int numberOfEntries()

    - #### getFunctions

          public java.lang.Iterable<Function> getFunctions()

      Description copied from interface: `Restriction`
      Return an Iterable over all of the functions (both native and user-defined) used by any component of the restriction
      Returns:
        functions all functions found (may contain duplicates)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### hasBound

          public boolean hasBound(Bound b)

      Description copied from interface: `Restriction`
      Checks if the specified bound is set or not.
      Specified by:
        `hasBound` in interface `Restriction`
      Parameters:
        `b` - the bound type
      Returns:
        `true` if the specified bound is set, `false` otherwise

    - #### appendBoundTo

          public CompositesBuilder appendBoundTo(CFMetaData cfm,
                                                 CompositesBuilder builder,
                                                 Bound bound,
                                                 QueryOptions options)

      Description copied from interface: `Restriction`
      Appends the values of the `Restriction` for the specified bound to the specified builder.
      Specified by:
        `appendBoundTo` in interface `Restriction`
      Parameters:
        `cfm` - the table metadata
        `builder` - the `CompositesBuilder` to append to.
        `bound` - the bound
        `options` - the query options
      Returns:
        the `CompositesBuilder`

    - #### isInclusive

          public boolean isInclusive(Bound b)

      Description copied from interface: `Restriction`
      Checks if the specified bound is inclusive or not.
      Specified by:
        `isInclusive` in interface `Restriction`
      Parameters:
        `b` - the bound type
      Returns:
        `true` if the specified bound is inclusive, `false` otherwise

    - #### isOnToken

          public boolean isOnToken()

      Specified by:
        `isOnToken` in interface `Restriction`

    - #### isMultiColumn

          public boolean isMultiColumn()

      Specified by:
        `isMultiColumn` in interface `Restriction`

    - #### isSlice

          public boolean isSlice()

      Specified by:
        `isSlice` in interface `Restriction`

    - #### isEQ

          public boolean isEQ()

      Specified by:
        `isEQ` in interface `Restriction`

    - #### isIN

          public boolean isIN()

      Specified by:
        `isIN` in interface `Restriction`

    - #### isNotReturningAnyRows

          public boolean isNotReturningAnyRows(CFMetaData cfm,
                                               QueryOptions options)

      Description copied from interface: `Restriction`
      Checks if this restriction will prevent the query to return any rows.
      Specified by:
        `isNotReturningAnyRows` in interface `Restriction`
      Parameters:
        `cfm` - the table metadata
        `options` - the query options
      Returns:
        `true` if this restriction will prevent the query to return any rows, otherwise

    - #### validateIndexedValue

          protected static java.nio.ByteBuffer validateIndexedValue(ColumnSpecification columnSpec,
                                                                    java.nio.ByteBuffer value)
                                                             throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### reverseBoundIfNeeded

          protected static Bound reverseBoundIfNeeded(ColumnDefinition columnDefinition,
                                                      Bound bound)

      Reverses the specified bound if the column type is a reversed one.
      Parameters:
        `columnDefinition` - the column definition
        `bound` - the bound
      Returns:
        the bound reversed if the column type was a reversed one or the original bound

Copyright © 2018 The Apache Software Foundation