Interface AbstractTwoValueCondition.Filterable<T>

Type Parameters:
T - the Java type related to the database column type
All Known Implementing Classes:
IsBetween, IsBetweenWhenPresent, IsNotBetween, IsNotBetweenWhenPresent
Enclosing class:
AbstractTwoValueCondition<T>

public static interface AbstractTwoValueCondition.Filterable<T>
Conditions may implement Filterable to add optionality to rendering.

If a condition is Filterable, then a user may add a filter to the usage of the condition that makes a decision whether to render the condition at runtime. Conditions that fail the filter will be dropped from the rendered SQL.

Implementations of Filterable may call AbstractTwoValueCondition.filterSupport(Predicate, Supplier, AbstractTwoValueCondition) or AbstractTwoValueCondition.filterSupport(BiPredicate, Supplier, AbstractTwoValueCondition) as a common implementation of the filtering algorithm.

  • Method Details

    • filter

      AbstractTwoValueCondition<T> filter(BiPredicate<? super @NonNull T,? super @NonNull T> predicate)
      If renderable and the values match the predicate, returns this condition. Else returns a condition that will not render.
      Parameters:
      predicate - predicate applied to the values, if renderable
      Returns:
      this condition if renderable and the values match the predicate, otherwise a condition that will not render.
    • filter

      AbstractTwoValueCondition<T> filter(Predicate<? super @NonNull T> predicate)
      If renderable and both values match the predicate, returns this condition. Else returns a condition that will not render. This function implements a short-circuiting test. If the first value does not match the predicate, then the second value will not be tested.
      Parameters:
      predicate - predicate applied to both values, if renderable
      Returns:
      this condition if renderable and the values match the predicate, otherwise a condition that will not render.