MultiColumnRestriction (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.cql3.restrictions

## Class MultiColumnRestriction

- java.lang.Object
- - org.apache.cassandra.cql3.restrictions.MultiColumnRestriction

- All Implemented Interfaces:
    Restriction, SingleRestriction
  Direct Known Subclasses:
    MultiColumnRestriction.EQRestriction, MultiColumnRestriction.INRestriction, MultiColumnRestriction.NotNullRestriction, MultiColumnRestriction.SliceRestriction

      public abstract class MultiColumnRestriction
      extends java.lang.Object
      implements SingleRestriction

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MultiColumnRestriction.EQRestriction`
    `static class` | `MultiColumnRestriction.INRestriction`
    `static class` | `MultiColumnRestriction.InRestrictionWithMarker` An IN restriction that uses a single marker for a set of IN values that are tuples.
    `static class` | `MultiColumnRestriction.InRestrictionWithValues` An IN restriction that has a set of terms for in values.
    `static class` | `MultiColumnRestriction.NotNullRestriction`
    `static class` | `MultiColumnRestriction.SliceRestriction`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.List<ColumnDefinition>` | `columnDefs` The columns to which the restriction apply.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiColumnRestriction(java.util.List<ColumnDefinition> columnDefs)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract SingleRestriction` | `doMergeWith(SingleRestriction otherRestriction)`
    `java.util.List<ColumnDefinition>` | `getColumnDefs()` Returns the column definitions in position order.
    `protected java.lang.String` | `getColumnsInCommons(Restriction otherRestriction)` Returns the names of the columns that are specified within this `Restrictions` and the other one as a comma separated `String`.
    `ColumnDefinition` | `getFirstColumn()` Returns the definition of the first column.
    `ColumnDefinition` | `getLastColumn()` Returns the definition of the last column.
    `boolean` | `hasSupportingIndex(SecondaryIndexManager indexManager)` Check if the restriction is on indexed columns.
    `boolean` | `isMultiColumn()`
    `protected abstract boolean` | `isSupportedBy(Index index)` Check if this type of restriction is supported for by the specified index.
    `SingleRestriction` | `mergeWith(SingleRestriction otherRestriction)` Merges this restriction with the specified one.

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

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

    - ### Methods inherited from interface org.apache.cassandra.cql3.restrictions.SingleRestriction

      `appendBoundTo, appendTo, hasBound, isContains, isEQ, isIN, isInclusive, isLIKE, isNotNull, isSlice`

    - ### Methods inherited from interface org.apache.cassandra.cql3.restrictions.Restriction

      `addFunctionsTo, addRowFilterTo, isOnToken`

- - ### Field Detail

    - #### columnDefs

          protected final java.util.List<ColumnDefinition> columnDefs

      The columns to which the restriction apply.

  - ### Constructor Detail

    - #### MultiColumnRestriction

          public MultiColumnRestriction(java.util.List<ColumnDefinition> columnDefs)

  - ### Method Detail

    - #### isMultiColumn

          public boolean isMultiColumn()

      Specified by:
        `isMultiColumn` in interface `SingleRestriction`

    - #### getFirstColumn

          public ColumnDefinition getFirstColumn()

      Description copied from interface: `Restriction`
      Returns the definition of the first column.
      Specified by:
        `getFirstColumn` in interface `Restriction`
      Returns:
        the definition of the first column.

    - #### getLastColumn

          public ColumnDefinition getLastColumn()

      Description copied from interface: `Restriction`
      Returns the definition of the last column.
      Specified by:
        `getLastColumn` in interface `Restriction`
      Returns:
        the definition of the last column.

    - #### getColumnDefs

          public java.util.List<ColumnDefinition> getColumnDefs()

      Description copied from interface: `Restriction`
      Returns the column definitions in position order.
      Specified by:
        `getColumnDefs` in interface `Restriction`
      Returns:
        the column definitions in position order.

    - #### mergeWith

          public final SingleRestriction mergeWith(SingleRestriction otherRestriction)

      Description copied from interface: `SingleRestriction`
      Merges this restriction with the specified one.

      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.

      Specified by:
        `mergeWith` in interface `SingleRestriction`
      Parameters:
        `otherRestriction` - the restriction to merge into this one
      Returns:
        the restriction resulting of the merge

    - #### doMergeWith

          protected abstract SingleRestriction doMergeWith(SingleRestriction otherRestriction)

    - #### getColumnsInCommons

          protected final java.lang.String getColumnsInCommons(Restriction otherRestriction)

      Returns the names of the columns that are specified within this `Restrictions` and the other one as a comma separated `String`.
      Parameters:
        `otherRestriction` - the other restrictions
      Returns:
        the names of the columns that are specified within this `Restrictions` and the other one as a comma separated `String`.

    - #### hasSupportingIndex

          public final boolean hasSupportingIndex(SecondaryIndexManager indexManager)

      Description copied from interface: `Restriction`
      Check if the restriction is on indexed columns.
      Specified by:
        `hasSupportingIndex` in interface `Restriction`
      Parameters:
        `indexManager` - the index manager
      Returns:
        `true` if the restriction is on indexed columns, `false`

    - #### isSupportedBy

          protected abstract boolean isSupportedBy(Index index)

      Check if this type of restriction is supported for by the specified index.
      Parameters:
        `index` - the secondary index
      Returns:
        `true` this type of restriction is supported by the specified index, `false` otherwise.

Copyright © 2018 The Apache Software Foundation