Query.CompositeFilter (Google App Engine API for Java)

com.google.appengine.api.datastore

Class 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
    • Method Detail

      • 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