com.google.appengine.api.datastore

## Class Query.CompositeFilter

- java.lang.Object
- - com.google.appengine.api.datastore.Query.Filter
  - - com.google.appengine.api.datastore.Query.CompositeFilter

- All Implemented Interfaces:
    java.io.Serializable
  Enclosing class:
    Query

      public static final class Query.CompositeFilter
      extends Query.Filter

  A `Query.Filter` that combines several sub filters using a `Query.CompositeFilterOperator`.

  For example, to construct a filter of the form `a = 1 AND (b = 2 OR c = 3)` use:

       new CompositeFilter(CompositeFilterOperator.AND, Arrays.asList(
           new FilterPredicate("a", FilterOperator.EQUAL, 1),
           new CompositeFilter(CompositeFilterOperator.OR, Arrays.<Filter>asList(
               new FilterPredicate("b", FilterOperator.EQUAL, 2),
               new FilterPredicate("c", FilterOperator.EQUAL, 3)))));

  or

       CompositeFilterOperator.and(
           FilterOperator.EQUAL.of("a", 1),
           CompositeFilterOperator.or(
               FilterOperator.EQUAL.of("b", 2),
               FilterOperator.EQUAL.of("c", 3)));

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositeFilter(Query.CompositeFilterOperator operator, java.util.Collection<Query.Filter> subFilters)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `Query.CompositeFilterOperator` | `getOperator()` Returns the operator.
    `java.util.List<Query.Filter>` | `getSubFilters()` Returns an immutable list of sub filters.
    `int` | `hashCode()`
    `java.lang.String` | `toString()`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CompositeFilter

          public CompositeFilter(Query.CompositeFilterOperator operator,
                                 java.util.Collection<Query.Filter> subFilters)

  - ### Method Detail

    - #### getOperator

          public Query.CompositeFilterOperator getOperator()

      Returns the operator.

    - #### getSubFilters

          public java.util.List<Query.Filter> getSubFilters()

      Returns an immutable list of sub filters.

    - #### toString

          public java.lang.String toString()

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

    - #### hashCode

          public int hashCode()

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

    - #### equals

          public boolean equals(java.lang.Object obj)

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