FirstMatchFilter

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

A filter, which returns the first FilterResult.Match result from filters. Only skips if all sub-filters skip, and only yields mismatch if no sub-filters yield match.

Parameters

T

The type the filter accepts

TResult

The type the filter returns

filters

The sub-filters to evaluate

Constructors

Link copied to clipboard
public FirstMatchFilter<T, TResult> FirstMatchFilter<T extends Any, TResult extends Any>(Filter<T, ? extends TResult> filters)

Alternative constructor with variable arguments

public FirstMatchFilter<T, TResult> FirstMatchFilter<T extends Any, TResult extends Any>(Iterable<Filter<T, ? extends TResult>> filters)

Functions

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

Evaluates the filter with the given value.

Link copied to clipboard
public Iterator<Filter<T, ? extends TResult>> iterator()
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, ? extends TResult>> p0)
Link copied to clipboard
public Spliterator<Filter<T, ? extends TResult>> spliterator()