com.holonplatform.core.query

## Interface QueryFilter

- All Superinterfaces:
    Expression, Serializable
  All Known Subinterfaces:
    QueryFilter.CompositeQueryFilter, QueryFilter.OperationQueryFilter<T>

      public interface QueryFilter
      extends Expression, Serializable

  A `Query` expression representing a filter (query restriction) condition.
  Since:
    4.4.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `QueryFilter.CompositeQueryFilter` A `QueryFilter` which represents a query filters composition.
    `static class` | `QueryFilter.FilterOperator` Filter operators.
    `static interface` | `QueryFilter.OperationQueryFilter<T>` A `QueryFilter` which represents an operation with operator and arguments.
    `static interface` | `QueryFilter.QueryFilterResolver<T extends QueryFilter>` Convenience interface to create an `ExpressionResolver` to resolve a custom `QueryFilter` class into a standard `QueryFilter`.
    `static interface` | `QueryFilter.QueryFilterSupport<C extends QueryFilter.QueryFilterSupport<C>>` Interface implemented by classes which support `QueryFilter`s addition.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Expression

      `Expression.ExpressionResolverFunction<E extends Expression,R extends Expression>, Expression.InvalidExpressionException`

  - ### Method Summary

    All Methods Static Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <Q extends QueryFilter> Optional<QueryFilter>` | `allOf(Iterable<Q> filters)` Build a QueryFilter with the conjunction (AND) of all given `filters`
    `static Optional<QueryFilter>` | `allOf(QueryFilter... filters)` Build a QueryFilter with the conjunction (AND) of all given not null `filters`
    `default QueryFilter` | `and(QueryFilter filter)` Join another `filter` in `AND` mode.
    `static <Q extends QueryFilter> Optional<QueryFilter>` | `anyOf(Iterable<Q> filters)` Build a QueryFilter with the disjunction (OR) of all given `filters`
    `static Optional<QueryFilter>` | `anyOf(QueryFilter... filters)` Build a QueryFilter with the disjunction (OR) of all given not null `filters`
    `static <T> QueryFilter` | `between(QueryExpression<T> expression, T from, T to)` Build a `QueryFilter.FilterOperator.BETWEEN` filter using given `expression`, which checks if expression value is between given `from` and `to` values.
    `static QueryFilter` | `contains(QueryExpression<String> expression, String value, boolean ignoreCase)` Build a contains filter on given `String` `expression`, checking if the `expression` value contains given value.
    `static QueryFilter` | `endsWith(QueryExpression<String> expression, String value, boolean ignoreCase)` Build a ends with filter on given `String` `expression`, checking if the `expression` value ends with given value.
    `static <T> QueryFilter` | `eq(QueryExpression<T> left, QueryExpression<? super T> right)` Build a `QueryFilter.FilterOperator.EQUAL` filter using given `left` and `right` operands, which checks if left expression value is equal to right expression value.
    `static <T> QueryFilter` | `eq(QueryExpression<T> expression, T value)` Build a `QueryFilter.FilterOperator.EQUAL` filter using given `expression`, which checks if expression value is equal to given constant value.
    `static <T> QueryFilter` | `goe(QueryExpression<T> left, QueryExpression<? super T> right)` Build a `QueryFilter.FilterOperator.GREATER_OR_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is greater than or equal to right expression value.
    `static <T> QueryFilter` | `goe(QueryExpression<T> expression, T value)` Build a `QueryFilter.FilterOperator.GREATER_OR_EQUAL` filter using given `expression`, which checks if expression value is greater than or equal to given constant value.
    `static <T> QueryFilter` | `greaterThan(QueryExpression<T> left, QueryExpression<? super T> right, boolean includeEquals)` Build a `QueryFilter.FilterOperator.GREATER_THAN` or a `QueryFilter.FilterOperator.GREATER_OR_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is greater than or greater than or equal to right expression value.
    `static <T> QueryFilter` | `greaterThan(QueryExpression<T> expression, T value, boolean includeEquals)` Build a `QueryFilter.FilterOperator.GREATER_THAN` or a `QueryFilter.FilterOperator.GREATER_OR_EQUAL` filter using given `expression`, which checks if expression value is greater than or greater than or equal to given constant value.
    `static <T> QueryFilter` | `gt(QueryExpression<T> left, QueryExpression<? super T> right)` Build a `QueryFilter.FilterOperator.GREATER_THAN` filter using given `left` and `right` operands, which checks if left expression value is greater than right expression value.
    `static <T> QueryFilter` | `gt(QueryExpression<T> expression, T value)` Build a `QueryFilter.FilterOperator.GREATER_THAN` filter using given `expression`, which checks if expression value is greater than given constant value.
    `static <T> QueryFilter` | `in(QueryExpression<T> expression, Collection<T> values)` Build a `QueryFilter.FilterOperator.IN` filter using given `expression`, which checks if expression value is equal to any of the given constant values.
    `static <T> QueryFilter` | `in(QueryExpression<T> left, QueryExpression<? super T> right)` Build a `QueryFilter.FilterOperator.IN` filter using given `left` and `right` operands, which checks if left expression value is equal to any of the right expression values.
    `static <T> QueryFilter` | `in(QueryExpression<T> expression, T... values)` Build a `QueryFilter.FilterOperator.IN` filter using given `expression`, which checks if expression value is equal to any of the given constant values.
    `static <T> QueryFilter` | `isNotNull(QueryExpression<T> expression)` Build a `QueryFilter.FilterOperator.NOT_NULL` filter on given `expression`, which checks if given expression value is not `null`.
    `static <T> QueryFilter` | `isNull(QueryExpression<T> expression)` Build a `QueryFilter.FilterOperator.NULL` filter on given `expression`, which checks if given expression value is `null`.
    `static <T> QueryFilter` | `lessThan(QueryExpression<T> left, QueryExpression<? super T> right, boolean includeEquals)` Build a `QueryFilter.FilterOperator.LESS_THAN` or a `QueryFilter.FilterOperator.LESS_OR_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is less than or less than or equal to right expression value.
    `static <T> QueryFilter` | `lessThan(QueryExpression<T> expression, T value, boolean includeEquals)` Build a `QueryFilter.FilterOperator.LESS_THAN` or a `QueryFilter.FilterOperator.LESS_OR_EQUAL` filter using given `expression`, which checks if expression value is less than or less than or equal to given constant value.
    `static <T> QueryFilter` | `loe(QueryExpression<T> left, QueryExpression<? super T> right)` Build a `QueryFilter.FilterOperator.LESS_OR_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is less than or equal to right expression value.
    `static <T> QueryFilter` | `loe(QueryExpression<T> expression, T value)` Build a `QueryFilter.FilterOperator.LESS_OR_EQUAL` filter using given `expression`, which checks if expression value is less than or equal to given constant value.
    `static <T> QueryFilter` | `lt(QueryExpression<T> left, QueryExpression<? super T> right)` Build a `QueryFilter.FilterOperator.LESS_THAN` filter using given `left` and `right` operands, which checks if left expression value is less than right expression value.
    `static <T> QueryFilter` | `lt(QueryExpression<T> expression, T value)` Build a `QueryFilter.FilterOperator.LESS_THAN` filter using given `expression`, which checks if expression value is less than given constant value.
    `static <T> QueryFilter` | `neq(QueryExpression<T> left, QueryExpression<? super T> right)` Build a `QueryFilter.FilterOperator.NOT_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is not equal to right expression value.
    `static <T> QueryFilter` | `neq(QueryExpression<T> expression, T value)` Build a `QueryFilter.FilterOperator.NOT_EQUAL` filter using given `expression`, which checks if expression value is not equal to given constant value.
    `static <T> QueryFilter` | `nin(QueryExpression<T> expression, Collection<T> values)` Build a `QueryFilter.FilterOperator.NOT_IN` filter using given `expression`, which checks if expression value is not included in given constant values.
    `static <T> QueryFilter` | `nin(QueryExpression<T> left, QueryExpression<? super T> right)` Build a `QueryFilter.FilterOperator.NOT_IN` filter using given `left` and `right` operands, which checks if left expression value is not included in the right expression values.
    `static <T> QueryFilter` | `nin(QueryExpression<T> expression, T... values)` Build a `QueryFilter.FilterOperator.NOT_IN` filter using given `expression`, which checks if expression value is not included in given constant values.
    `default QueryFilter` | `not()` Negate this filter.
    `static QueryFilter` | `not(QueryFilter filter)` Build a QueryFilter as ne negation of given `filter`.
    `default QueryFilter` | `or(QueryFilter filter)` Join another `filter` in `OR` mode.
    `static QueryFilter` | `startsWith(QueryExpression<String> expression, String value, boolean ignoreCase)` Build a starts with filter on given `String` `expression`, checking if the `expression` value starts with given value.

    - ### Methods inherited from interface com.holonplatform.core.Expression

      `validate`

- - ### Method Detail

    - #### not

          default QueryFilter not()

      Negate this filter.
      Returns:
        Negated filter

    - #### and

          default QueryFilter and(QueryFilter filter)

      Join another `filter` in `AND` mode.
      Parameters:
        `filter` - QueryFilter to join (not null)
      Returns:
        Conjunction of this filter and given `filter`

    - #### or

          default QueryFilter or(QueryFilter filter)

      Join another `filter` in `OR` mode.
      Parameters:
        `filter` - QueryFilter to join (not null)
      Returns:
        Disjunction of this filter and given `filter`

    - #### isNull

          static <T> QueryFilter isNull(QueryExpression<T> expression)

      Build a `QueryFilter.FilterOperator.NULL` filter on given `expression`, which checks if given expression value is `null`.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
      Returns:
        QueryFilter

    - #### isNotNull

          static <T> QueryFilter isNotNull(QueryExpression<T> expression)

      Build a `QueryFilter.FilterOperator.NOT_NULL` filter on given `expression`, which checks if given expression value is not `null`.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
      Returns:
        QueryFilter

    - #### eq

          static <T> QueryFilter eq(QueryExpression<T> left,
                                    QueryExpression<? super T> right)

      Build a `QueryFilter.FilterOperator.EQUAL` filter using given `left` and `right` operands, which checks if left expression value is equal to right expression value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
      Returns:
        QueryFilter

    - #### eq

          static <T> QueryFilter eq(QueryExpression<T> expression,
                                    T value)

      Build a `QueryFilter.FilterOperator.EQUAL` filter using given `expression`, which checks if expression value is equal to given constant value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Constant value (not null)
      Returns:
        QueryFilter

    - #### neq

          static <T> QueryFilter neq(QueryExpression<T> left,
                                     QueryExpression<? super T> right)

      Build a `QueryFilter.FilterOperator.NOT_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is not equal to right expression value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
      Returns:
        QueryFilter

    - #### neq

          static <T> QueryFilter neq(QueryExpression<T> expression,
                                     T value)

      Build a `QueryFilter.FilterOperator.NOT_EQUAL` filter using given `expression`, which checks if expression value is not equal to given constant value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Constant value (not null)
      Returns:
        QueryFilter

    - #### lessThan

          static <T> QueryFilter lessThan(QueryExpression<T> left,
                                          QueryExpression<? super T> right,
                                          boolean includeEquals)

      Build a `QueryFilter.FilterOperator.LESS_THAN` or a `QueryFilter.FilterOperator.LESS_OR_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is less than or less than or equal to right expression value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
        `includeEquals` - `true` to use the `QueryFilter.FilterOperator.LESS_OR_EQUAL` operator (which includes value equality), `false` to use the `QueryFilter.FilterOperator.LESS_THAN` operator
      Returns:
        QueryFilter

    - #### lessThan

          static <T> QueryFilter lessThan(QueryExpression<T> expression,
                                          T value,
                                          boolean includeEquals)

      Build a `QueryFilter.FilterOperator.LESS_THAN` or a `QueryFilter.FilterOperator.LESS_OR_EQUAL` filter using given `expression`, which checks if expression value is less than or less than or equal to given constant value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Constant value (not null)
        `includeEquals` - `true` to use the `QueryFilter.FilterOperator.LESS_OR_EQUAL` operator (which includes value equality), `false` to use the `QueryFilter.FilterOperator.LESS_THAN` operator
      Returns:
        QueryFilter

    - #### lt

          static <T> QueryFilter lt(QueryExpression<T> left,
                                    QueryExpression<? super T> right)

      Build a `QueryFilter.FilterOperator.LESS_THAN` filter using given `left` and `right` operands, which checks if left expression value is less than right expression value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
      Returns:
        QueryFilter

    - #### lt

          static <T> QueryFilter lt(QueryExpression<T> expression,
                                    T value)

      Build a `QueryFilter.FilterOperator.LESS_THAN` filter using given `expression`, which checks if expression value is less than given constant value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Constant value (not null)
      Returns:
        QueryFilter

    - #### loe

          static <T> QueryFilter loe(QueryExpression<T> left,
                                     QueryExpression<? super T> right)

      Build a `QueryFilter.FilterOperator.LESS_OR_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is less than or equal to right expression value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
      Returns:
        QueryFilter

    - #### loe

          static <T> QueryFilter loe(QueryExpression<T> expression,
                                     T value)

      Build a `QueryFilter.FilterOperator.LESS_OR_EQUAL` filter using given `expression`, which checks if expression value is less than or equal to given constant value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Constant value (not null)
      Returns:
        QueryFilter

    - #### greaterThan

          static <T> QueryFilter greaterThan(QueryExpression<T> left,
                                             QueryExpression<? super T> right,
                                             boolean includeEquals)

      Build a `QueryFilter.FilterOperator.GREATER_THAN` or a `QueryFilter.FilterOperator.GREATER_OR_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is greater than or greater than or equal to right expression value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
        `includeEquals` - `true` to use the `QueryFilter.FilterOperator.GREATER_OR_EQUAL` operator (which includes value equality), `false` to use the `QueryFilter.FilterOperator.GREATER_THAN` operator
      Returns:
        QueryFilter

    - #### greaterThan

          static <T> QueryFilter greaterThan(QueryExpression<T> expression,
                                             T value,
                                             boolean includeEquals)

      Build a `QueryFilter.FilterOperator.GREATER_THAN` or a `QueryFilter.FilterOperator.GREATER_OR_EQUAL` filter using given `expression`, which checks if expression value is greater than or greater than or equal to given constant value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Constant value (not null)
        `includeEquals` - `true` to use the `QueryFilter.FilterOperator.GREATER_OR_EQUAL` operator (which includes value equality), `false` to use the `QueryFilter.FilterOperator.GREATER_THAN` operator
      Returns:
        QueryFilter

    - #### gt

          static <T> QueryFilter gt(QueryExpression<T> left,
                                    QueryExpression<? super T> right)

      Build a `QueryFilter.FilterOperator.GREATER_THAN` filter using given `left` and `right` operands, which checks if left expression value is greater than right expression value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
      Returns:
        QueryFilter

    - #### gt

          static <T> QueryFilter gt(QueryExpression<T> expression,
                                    T value)

      Build a `QueryFilter.FilterOperator.GREATER_THAN` filter using given `expression`, which checks if expression value is greater than given constant value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Constant value (not null)
      Returns:
        QueryFilter

    - #### goe

          static <T> QueryFilter goe(QueryExpression<T> left,
                                     QueryExpression<? super T> right)

      Build a `QueryFilter.FilterOperator.GREATER_OR_EQUAL` filter using given `left` and `right` operands, which checks if left expression value is greater than or equal to right expression value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
      Returns:
        QueryFilter

    - #### goe

          static <T> QueryFilter goe(QueryExpression<T> expression,
                                     T value)

      Build a `QueryFilter.FilterOperator.GREATER_OR_EQUAL` filter using given `expression`, which checks if expression value is greater than or equal to given constant value.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Constant value (not null)
      Returns:
        QueryFilter

    - #### between

          static <T> QueryFilter between(QueryExpression<T> expression,
                                         T from,
                                         T to)

      Build a `QueryFilter.FilterOperator.BETWEEN` filter using given `expression`, which checks if expression value is between given `from` and `to` values.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `from` - From value (not null)
        `to` - To value (not null)
      Returns:
        QueryFilter

    - #### in

          static <T> QueryFilter in(QueryExpression<T> left,
                                    QueryExpression<? super T> right)

      Build a `QueryFilter.FilterOperator.IN` filter using given `left` and `right` operands, which checks if left expression value is equal to any of the right expression values.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
      Returns:
        QueryFilter

    - #### in

          static <T> QueryFilter in(QueryExpression<T> expression,
                                    T... values)

      Build a `QueryFilter.FilterOperator.IN` filter using given `expression`, which checks if expression value is equal to any of the given constant values.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `values` - Filter values (not null)
      Returns:
        QueryFilter

    - #### in

          static <T> QueryFilter in(QueryExpression<T> expression,
                                    Collection<T> values)

      Build a `QueryFilter.FilterOperator.IN` filter using given `expression`, which checks if expression value is equal to any of the given constant values.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `values` - Filter values (not null)
      Returns:
        QueryFilter

    - #### nin

          static <T> QueryFilter nin(QueryExpression<T> left,
                                     QueryExpression<? super T> right)

      Build a `QueryFilter.FilterOperator.NOT_IN` filter using given `left` and `right` operands, which checks if left expression value is not included in the right expression values.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `left` - Left operand expression (not null)
        `right` - Right operand expression (not null)
      Returns:
        QueryFilter

    - #### nin

          static <T> QueryFilter nin(QueryExpression<T> expression,
                                     T... values)

      Build a `QueryFilter.FilterOperator.NOT_IN` filter using given `expression`, which checks if expression value is not included in given constant values.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `values` - Filter values (not null)
      Returns:
        QueryFilter

    - #### nin

          static <T> QueryFilter nin(QueryExpression<T> expression,
                                     Collection<T> values)

      Build a `QueryFilter.FilterOperator.NOT_IN` filter using given `expression`, which checks if expression value is not included in given constant values.
      Type Parameters:
        `T` - Expression type
      Parameters:
        `expression` - Filter expression (not null)
        `values` - Filter values (not null)
      Returns:
        QueryFilter

    - #### contains

          static QueryFilter contains(QueryExpression<String> expression,
                                      String value,
                                      boolean ignoreCase)

      Build a contains filter on given `String` `expression`, checking if the `expression` value contains given value.
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Value which must be contained in expression value
        `ignoreCase` - Whether to ignore case
      Returns:
        QueryFilter

    - #### startsWith

          static QueryFilter startsWith(QueryExpression<String> expression,
                                        String value,
                                        boolean ignoreCase)

      Build a starts with filter on given `String` `expression`, checking if the `expression` value starts with given value.
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Value with which the expression value must start with
        `ignoreCase` - Whether to ignore case
      Returns:
        QueryFilter

    - #### endsWith

          static QueryFilter endsWith(QueryExpression<String> expression,
                                      String value,
                                      boolean ignoreCase)

      Build a ends with filter on given `String` `expression`, checking if the `expression` value ends with given value.
      Parameters:
        `expression` - Filter expression (not null)
        `value` - Value with which the expression value must end with
        `ignoreCase` - Whether to ignore case
      Returns:
        QueryFilter

    - #### not

          static QueryFilter not(QueryFilter filter)

      Build a QueryFilter as ne negation of given `filter`.
      Parameters:
        `filter` - Filter to negate
      Returns:
        QueryFilter

    - #### allOf

          static Optional<QueryFilter> allOf(QueryFilter... filters)

      Build a QueryFilter with the conjunction (AND) of all given not null `filters`
      Parameters:
        `filters` - Filters
      Returns:
        QueryFilter representing the conjunction (AND) of all given QueryFilters, or an empty optional if no not-null filter is given

    - #### allOf

          static <Q extends QueryFilter> Optional<QueryFilter> allOf(Iterable<Q> filters)

      Build a QueryFilter with the conjunction (AND) of all given `filters`
      Type Parameters:
        `Q` - Actual filter type
      Parameters:
        `filters` - Filters
      Returns:
        QueryFilter representing the conjunction (AND) of all given QueryFilters, or an empty optional if given Iterable has no elements

    - #### anyOf

          static Optional<QueryFilter> anyOf(QueryFilter... filters)

      Build a QueryFilter with the disjunction (OR) of all given not null `filters`
      Parameters:
        `filters` - Filters
      Returns:
        QueryFilter representing the disjunction (OR) of all given filters, or an empty optional if no not-null filter is given

    - #### anyOf

          static <Q extends QueryFilter> Optional<QueryFilter> anyOf(Iterable<Q> filters)

      Build a QueryFilter with the disjunction (OR) of all given `filters`
      Type Parameters:
        `Q` - Actual filter type
      Parameters:
        `filters` - Filters
      Returns:
        QueryFilter representing the disjunction (OR) of all given QueryFilters, or an empty optional if given Iterable has no elements

Copyright © 2017 The Holon Platform. All rights reserved.