FirstMatchFilter

public class FirstMatchFilter<TInput extends Object, TResult extends Object> implements IFilter<TInput, TResult>, Iterable<IFilter<TInput, ? extends TResult>>(source)

A filter, which returns the first non-null evaluation from filters. It returns null, if none of filters return a non-null value, or filters is empty.

Parameters

TInput

The type the filter accepts

TResult

The type the filter returns

filters

The sub-filters to evaluate

Constructors

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

Alternative constructor with variable arguments

public FirstMatchFilter<TInput, TResult> FirstMatchFilter<TInput extends Any, TResult extends Any>(Collection<IFilter<TInput, ? extends TResult>> filters)

Functions

Link copied to clipboard
public TResult evaluate(TInput input)

Evaluates the filter with the given value.

Link copied to clipboard
public Iterator<IFilter<TInput, ? extends TResult>> iterator()
Link copied to clipboard
public String toString()

Inherited functions

Link copied to clipboard
public String dump()

Formats the current filter as a tree, and returns the formatted string.

Link copied to clipboard
public Unit forEach(Consumer<? super IFilter<TInput, ? extends TResult>> p0)
Link copied to clipboard