ConditionalFilter

public final class ConditionalFilter<T extends Object, TResult extends Object> implements Filter<T, TResult>, Iterable<Filter<T, TResult>>(source)

A filter, which forwards evaluation to the given filter, if the check function returns true. Otherwise, the result will be falseResult.

Parameters

T

The type the given filter accepts

TResult

The type filter returns

check

The function to decide if the evaluation should be forwarded to filter or return falseResult

falseResult

The result when the input is false

filter

The filter to evaluate

Constructors

Link copied to clipboard
public ConditionalFilter<T, TResult> ConditionalFilter<T extends Any, TResult extends Any>(Function1<T, Boolean> check, FilterResult<TResult> falseResult, Filter<T, TResult> filter)

Functions

Link copied to clipboard
public FilterResult<? extends TResult> evaluate(T value)

Evaluates the filter with the given value.

Link copied to clipboard
Link copied to clipboard
public String toString()

Inherited functions

Link copied to clipboard
public final String dump()

Formats a filter chain as a tree with ASCII characters, and returns the formatted string.

Link copied to clipboard
public Unit forEach(Consumer<? super Filter<T, TResult>> p0)
Link copied to clipboard