Interface Filter

All Superinterfaces:
Expression
All Known Subinterfaces:
LiteralFilter, ReindexingFilter, WhereFilter
All Known Implementing Classes:
AbstractConditionFilter, AbstractRangeFilter, AutoTuningIncrementalReleaseFilter, BaseIncrementalReleaseFilter, ByteRangeFilter, CharRangeFilter, ClockFilter, ComparableRangeFilter, ComposedFilter, ConditionFilter, ConjunctiveFilter, DisjunctiveFilter, DoubleRangeFilter, DownsampledWhereFilter, DynamicWhereFilter, FilterAnd, FilterBase, FilterComparison, FilterIn, FilterIsNull, FilterNot, FilterOr, FilterPattern, FloatRangeFilter, Function, IncrementalReleaseFilter, InstantRangeFilter, IntRangeFilter, LongRangeFilter, MatchFilter, Method, RangeConditionFilter, RawString, RollingReleaseFilter, ShortRangeFilter, SingleSidedComparableRangeFilter, SortedClockFilter, TimeSeriesFilter, UnsortedClockFilter, WhereFilterImpl, WhereFilterLivenessArtifactImpl, WhereNoneFilter

public interface Filter extends Expression
Represents an evaluate-able filter.
See Also:
  • Method Details

    • from

      static Collection<? extends Filter> from(String... expressions)
    • from

      static Collection<? extends Filter> from(Collection<String> expressions)
    • ofTrue

      static LiteralFilter ofTrue()
      Creates an always-true-filter.

      Equivalent to Literal.of(true).

      Returns:
      the always-true-filter
    • ofFalse

      static LiteralFilter ofFalse()
      Creates an always-false-filter.

      Equivalent to Literal.of(false).

      Returns:
      the always-false-filter
    • isNull

      static FilterIsNull isNull(Expression expression)
      Creates an is-null-filter.
      Parameters:
      expression - the expression
      Returns:
      the is-null-filter
    • isNotNull

      static FilterNot<FilterIsNull> isNotNull(Expression expression)
      Creates an is-not-null-filter.

      Equivalent to not(isNull(expression)).

      Parameters:
      expression - the expression
      Returns:
      the is-not-null-filter
    • isTrue

      static FilterComparison isTrue(Expression expression)
      Creates an is-true-filter.

      Equivalent to FilterComparison.eq(expression, ofTrue()).

      Parameters:
      expression - the expression
      Returns:
      the equals-true-filter
    • isFalse

      static FilterComparison isFalse(Expression expression)
      Creates an is-false-filter.

      Equivalent to FilterComparison.eq(expression, ofFalse()).

      Parameters:
      expression - the expression
      Returns:
    • not

      static <F extends Filter> FilterNot<F> not(F filter)
      Creates a not-filter from filter. Callers should typically prefer invert(), unless the "not" context needs to be preserved.
      Type Parameters:
      F - the type of filter
      Parameters:
      filter - the filter
      Returns:
      the not-filter
    • or

      static Filter or(Filter... filters)
      Creates a filter that evaluates to true when any of filters evaluates to true, and false when none of the filters evaluates to true. This implies that ofFalse() is returned when filters is empty.
      Parameters:
      filters - the filters
      Returns:
      the filter
    • or

      static Filter or(Collection<? extends Filter> filters)
      Creates a filter that evaluates to true when any of filters evaluates to true, and false when none of the filters evaluates to true. This implies that ofFalse() is returned when filters is empty.
      Parameters:
      filters - the filters
      Returns:
      the filter
    • and

      static Filter and(Filter... filters)
      Creates a filter that evaluates to true when all of the filters evaluate to true, and false when any of the filters evaluates to false. This implies that ofTrue() is returned when filters is empty.
      Parameters:
      filters - the filters
      Returns:
      the filter
    • and

      static Filter and(Collection<? extends Filter> filters)
      Creates a filter that evaluates to true when all of the filters evaluate to true, and false when any of the filters evaluates to false. This implies that ofTrue() is returned when filters is empty.
      Parameters:
      filters - the filters
      Returns:
      the filter
    • extractAnds

      static Collection<Filter> extractAnds(Filter filter)
      Performs a non-recursive "and-extraction" against filter. If filter is a FilterAnd, FilterAnd.filters() will be returned. If filter is ofTrue(), an empty list will be returned. Otherwise, a singleton list of filter will be returned.
      Parameters:
      filter - the filter
      Returns:
      the and-extracted filter
    • invert

      Filter invert()
      The logical inversion of this. While logically equivalent to Filter.not(this), implementations of this method will return more specifically typed inversions where applicable.
      Returns:
      the inverse filter
      See Also:
    • walk

      <T> T walk(Filter.Visitor<T> visitor)