Class AbstractListValueCondition<T>

java.lang.Object
org.mybatis.dynamic.sql.AbstractListValueCondition<T>
All Implemented Interfaces:
VisitableCondition<T>
Direct Known Subclasses:
IsIn, IsInCaseInsensitive, IsInCaseInsensitiveWhenPresent, IsInWhenPresent, IsNotIn, IsNotInCaseInsensitive, IsNotInCaseInsensitiveWhenPresent, IsNotInWhenPresent

public abstract class AbstractListValueCondition<T> extends Object implements VisitableCondition<T>
  • Field Details

  • Constructor Details

    • AbstractListValueCondition

      protected AbstractListValueCondition(Collection<T> values)
  • Method Details

    • values

      public final Stream<T> values()
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: VisitableCondition
      Subclasses can override this to indicate whether the condition is considered empty. This is primarily used in map and filter operations - the map and filter functions will not be applied if the condition is empty.
      Specified by:
      isEmpty in interface VisitableCondition<T>
      Returns:
      true if the condition is empty.
    • accept

      public <R> R accept(ConditionVisitor<T,R> visitor)
      Specified by:
      accept in interface VisitableCondition<T>
    • filterSupport

      protected <S extends AbstractListValueCondition<T>> S filterSupport(Predicate<? super T> predicate, Function<Collection<T>,S> constructor, S self, Supplier<S> emptySupplier)
    • mapSupport

      protected <R, S extends AbstractListValueCondition<R>> S mapSupport(Function<? super T,? extends R> mapper, Function<Collection<R>,S> constructor, Supplier<S> emptySupplier)
    • filter

      public abstract AbstractListValueCondition<T> filter(Predicate<? super T> predicate)
      If not empty, apply the predicate to each value in the list and return a new condition with the filtered values. Else returns an empty condition (this).
      Parameters:
      predicate - predicate applied to the values, if not empty
      Returns:
      a new condition with filtered values if renderable, otherwise an empty condition
    • operator

      public abstract String operator()