com.holonplatform.core.query

## Interface QueryFilter

- All Superinterfaces:
    Expression, Serializable
  All Known Subinterfaces:
    QueryFilter.CompositeQueryFilter

      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 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(TypedExpression<T> expression, T from, T to)` Build a `QueryFilter` using given `expression`, which checks if expression value is between given `from` and `to` values.
    `static QueryFilter` | `contains(TypedExpression<String> expression, String value, boolean ignoreCase)` Build a contains `QueryFilter` on given `String` `expression`, checking if the `expression` value contains given value.
    `static QueryFilter` | `endsWith(TypedExpression<String> expression, String value, boolean ignoreCase)` Build a ends with `QueryFilter` on given `String` `expression`, checking if the `expression` value ends with given value.
    `static <T> QueryFilter` | `eq(TypedExpression<T> expression, T value)` Build a `QueryFilter` using given `expression`, which checks if expression value is equal to given constant value.
    `static <T> QueryFilter` | `eq(TypedExpression<T> left, TypedExpression<? super T> right)` Build a `QueryFilter` using given `left` and `right` operands, which checks if left expression value is equal to right expression value.
    `static <T> QueryFilter` | `goe(TypedExpression<T> expression, T value)` Build a `QueryFilter` using given `expression`, which checks if expression value is greater than or equal to given constant value.
    `static <T> QueryFilter` | `goe(TypedExpression<T> left, TypedExpression<? super T> right)` Build a `QueryFilter` using given `left` and `right` operands, which checks if left expression value is greater than or equal to right expression value.
    `static <T> QueryFilter` | `greaterThan(TypedExpression<T> expression, T value, boolean includeEquals)` Build a `QueryFilter` using given `expression`, which checks if expression value is greater than or greater than or equal to given constant value.
    `static <T> QueryFilter` | `greaterThan(TypedExpression<T> left, TypedExpression<? super T> right, boolean includeEquals)` Build a `QueryFilter` 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` | `gt(TypedExpression<T> expression, T value)` Build a `QueryFilter` using given `expression`, which checks if expression value is greater than given constant value.
    `static <T> QueryFilter` | `gt(TypedExpression<T> left, TypedExpression<? super T> right)` Build a `QueryFilter` using given `left` and `right` operands, which checks if left expression value is greater than right expression value.
    `static <T> QueryFilter` | `in(TypedExpression<T> expression, Collection<T> values)` Build a `QueryFilter` using given `expression`, which checks if expression value is equal to any of the given constant values.
    `static <T> QueryFilter` | `in(TypedExpression<T> expression, T... values)` Build a `QueryFilter` using given `expression`, which checks if expression value is equal to any of the given constant values.
    `static <T> QueryFilter` | `in(TypedExpression<T> left, TypedExpression<? super T> right)` Build a `QueryFilter` using given `left` and `right` operands, which checks if left expression value is equal to any of the right expression values.
    `static <T> QueryFilter` | `isNotNull(TypedExpression<T> expression)` Build a `QueryFilter` on given `expression`, which checks if given expression value is not `null`.
    `static <T> QueryFilter` | `isNull(TypedExpression<T> expression)` Build a `QueryFilter` on given `expression`, which checks if given expression value is `null`.
    `static <T> QueryFilter` | `lessThan(TypedExpression<T> expression, T value, boolean includeEquals)` Build a `QueryFilter` using given `expression`, which checks if expression value is less than or less than or equal to given constant value.
    `static <T> QueryFilter` | `lessThan(TypedExpression<T> left, TypedExpression<? super T> right, boolean includeEquals)` Build a `QueryFilter` 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` | `loe(TypedExpression<T> expression, T value)` Build a `QueryFilter` using given `expression`, which checks if expression value is less than or equal to given constant value.
    `static <T> QueryFilter` | `loe(TypedExpression<T> left, TypedExpression<? super T> right)` Build a `QueryFilter` using given `left` and `right` operands, which checks if left expression value is less than or equal to right expression value.
    `static <T> QueryFilter` | `lt(TypedExpression<T> expression, T value)` Build a `QueryFilter` using given `expression`, which checks if expression value is less than given constant value.
    `static <T> QueryFilter` | `lt(TypedExpression<T> left, TypedExpression<? super T> right)` Build a `QueryFilter` using given `left` and `right` operands, which checks if left expression value is less than right expression value.
    `static <T> QueryFilter` | `neq(TypedExpression<T> expression, T value)` Build a `QueryFilter` using given `expression`, which checks if expression value is not equal to given constant value.
    `static <T> QueryFilter` | `neq(TypedExpression<T> left, TypedExpression<? super T> right)` Build a `QueryFilter` using given `left` and `right` operands, which checks if left expression value is not equal to right expression value.
    `static <T> QueryFilter` | `nin(TypedExpression<T> expression, Collection<T> values)` Build a `QueryFilter` using given `expression`, which checks if expression value is not included in given constant values.
    `static <T> QueryFilter` | `nin(TypedExpression<T> expression, T... values)` Build a `QueryFilter` using given `expression`, which checks if expression value is not included in given constant values.
    `static <T> QueryFilter` | `nin(TypedExpression<T> left, TypedExpression<? super T> right)` Build a `QueryFilter` using given `left` and `right` operands, which checks if left expression value is not included in the right expression 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(TypedExpression<String> expression, String value, boolean ignoreCase)` Build a starts with `QueryFilter` 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(TypedExpression<T> expression)

      Build a `QueryFilter` 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(TypedExpression<T> expression)

      Build a `QueryFilter` 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(TypedExpression<T> left,
                                    TypedExpression<? super T> right)

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                    T value)

      Build a `QueryFilter` 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(TypedExpression<T> left,
                                     TypedExpression<? super T> right)

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                     T value)

      Build a `QueryFilter` 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(TypedExpression<T> left,
                                          TypedExpression<? super T> right,
                                          boolean includeEquals)

      Build a `QueryFilter` 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 include value equality, `false` otherwise
      Returns:
        QueryFilter

    - #### lessThan

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

      Build a `QueryFilter` 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 include value equality, `false` otherwise
      Returns:
        QueryFilter

    - #### lt

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

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                    T value)

      Build a `QueryFilter` 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(TypedExpression<T> left,
                                     TypedExpression<? super T> right)

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                     T value)

      Build a `QueryFilter` 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(TypedExpression<T> left,
                                             TypedExpression<? super T> right,
                                             boolean includeEquals)

      Build a `QueryFilter` 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 include value equality, `false` otherwise
      Returns:
        QueryFilter

    - #### greaterThan

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

      Build a `QueryFilter` 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 include value equality, `false` otherwise
      Returns:
        QueryFilter

    - #### gt

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

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                    T value)

      Build a `QueryFilter` 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(TypedExpression<T> left,
                                     TypedExpression<? super T> right)

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                     T value)

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                         T from,
                                         T to)

      Build a `QueryFilter` 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(TypedExpression<T> left,
                                    TypedExpression<? super T> right)

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                    T... values)

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                    Collection<T> values)

      Build a `QueryFilter` 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(TypedExpression<T> left,
                                     TypedExpression<? super T> right)

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                     T... values)

      Build a `QueryFilter` 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(TypedExpression<T> expression,
                                     Collection<T> values)

      Build a `QueryFilter` 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(TypedExpression<String> expression,
                                      String value,
                                      boolean ignoreCase)

      Build a contains `QueryFilter` 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 (not null)
        `ignoreCase` - Whether to ignore case
      Returns:
        QueryFilter

    - #### startsWith

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

      Build a starts with `QueryFilter` 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 (not null)
        `ignoreCase` - Whether to ignore case
      Returns:
        QueryFilter

    - #### endsWith

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

      Build a ends with `QueryFilter` 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 (not null)
        `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 © 2019 The Holon Platform. All rights reserved.