Simple Filter DSL.

Remarks

The methods in this class are simple factory methods for various Filter classes. The use of these methods is strongly encouraged in lieu of direct construction of Filter classes as it makes the code more readable.

Hierarchy

  • Filters

Constructors

Methods

  • Return a composite filter representing logical AND of all specified filters.

    Returns

    a composite filter representing logical AND of all specified filters

    Parameters

    • Rest ...filters: Filter[]

      a variable number of filters

    Returns Filter

  • Return a filter that always evaluates to true.

    Returns

    a filter that always evaluates to true.

    Link

    AlwaysFilter

    Returns Filter

  • Return a composite filter representing logical OR of all specified filters.

    Returns

    a composite filter representing logical OR of all specified filters

    See

    AnyFilter

    Parameters

    • Rest ...filters: Filter[]

      an array of filters.

    Returns Filter

  • Return a filter that tests if the extracted array contains the specified value.

    Returns

    a filter that tests if the extracted array contains the specified value

    Type Parameters

    • E

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • value: E

      the object that a Collection or Object array is tested to contain

    Returns Filter

  • Return a filter that tests if the extracted array contains all of the specified values.

    Returns

    a filter that tests if the extracted array contains the specified values

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • values: Set<any>

      the object that a Collection or Object array is tested to contain

    Returns Filter

  • Return a filter that tests if the extracted array contains any of the specified values.

    Returns

    a filter that tests if the extracted array contains the specified values

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • values: Set<any>

      the object that a Collection or Object array is tested to contain

    Returns Filter

  • Return a filter that tests if the extracted value is between the specified values (inclusive).

    Returns

    a filter that tests if the extracted value is between the specified values

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • from: number

      the lower bound to compare the extracted value with

    • to: number

      the upper bound to compare the extracted value with

    • includeLowerBound: boolean = true

      a flag indicating whether values matching the lower bound evaluate to true

    • includeUpperBound: boolean = true

      a flag indicating whether values matching the upper bound evaluate to true

    Returns Filter

  • Return a filter that tests if the extracted collection contains the specified value.

    Returns

    a filter that tests if the extracted collection contains the specified value

    Type Parameters

    • E

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • value: E

      the object that a Collection or Object array is tested to contain

    Returns ContainsFilter<any>

  • Return a filter that tests if the extracted collection contains all of the specified values.

    Returns

    a filter that tests if the extracted collection contains all of the specified values.

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • values: Set<any>

      the object that a Collection or Object array is tested to contain

    Returns Filter

  • Return a filter that tests if the extracted collection contains any of the specified values.

    Returns

    a filter that tests if the extracted collection contains any of the specified values.

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • values: Set<any>

      the object that a Collection or Object array is tested to contain

    Returns Filter

  • Return a filter that tests for equality against the extracted value.

    Returns

    a filter that tests for equality

    Type Parameters

    • E = any

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • value: E

      the value to compare the extracted value with

    Returns EqualsFilter<any>

  • Return a filter that tests if the extracted value is greater than the specified value.

    Returns

    a filter that tests if the extracted value is greater than the specified value.

    Type Parameters

    • E = any

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • value: E

      the value to compare the extracted value with

    Returns GreaterFilter<any>

  • Return a filter that tests if the extracted value is greater than or equal to the specified value.

    Returns

    a filter that tests if the extracted value is greater than or equal to the specified value.

    Type Parameters

    • E = any

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • value: E

      the value to compare the extracted value with

    Returns GreaterFilter<any>

  • Return a filter that tests if the extracted value is contained in the specified array.

    Returns

    a filter that tests if the extracted value is contained in the specified array.

    See

    ContainsAnyFilter

    Type Parameters

    • E = any

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • values: Set<E>

      the values to compare the extracted value with

    Returns Filter

  • Return a filter that tests if the extracted value is less than the specified value.

    Returns

    a filter that tests if the extracted value is less than the specified value

    Type Parameters

    • E = any

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • value: E

      the value to compare the extracted value with

    Returns LessFilter<any>

  • Return a filter that tests if the extracted value is less than or equal to the specified value.

    Returns

    a filter that tests if the extracted value is less than or equal to the specified value

    Type Parameters

    • E = any

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • value: E

      the value to compare the extracted value with

    Returns Filter

  • Return a LikeFilter for pattern match.

    Returns

    a LikeFilter

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • pattern: string

      the string pattern to compare the result with

    • escape: string

      the escape character for escaping '%' and '_'

    • ignoreCase: boolean

      true to be case-insensitive

    Returns Filter

  • Return a filter that always evaluates to false.

    Returns

    a filter that always evaluates to false.

    Returns Filter

  • Return a filter that represents the logical negation of the specified filter.

    Returns

    a filter that represents the logical negation of the specified filter.

    Parameters

    Returns Filter

  • Return a filter that tests for non-equality.

    Returns

    a filter that tests for non-equality

    Type Parameters

    • E

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • value: E

      the value to compare the extracted value with

    Returns Filter

  • Return a filter that evaluates to true if an entry is present in the cache.

    Returns

    a filter that evaluates to true if an entry is present

    See

    PresentFilter

    Returns Filter

  • Return a RegexFilter for pattern match.

    Parameters

    • extractorOrMethod: string | ValueExtractor

      the ValueExtractor used by this filter or the name of the method to invoke via reflection

    • regex: string

      the Java regular expression to match the result with

    Returns Filter