optional

public final ConditionalFilter<Optional<TInput>, TResult> optional<TInput extends Any, TResult extends Any>(TResult notPresentResult, IFilter<TInput, TResult> filter)(source)

Creates a ConditionalFilter, which gets an Optional's value when passing to filter if present.

Parameters

TInput

The type the given filter accepts

TResult

The type filter returns

notPresentResult

The result when the input is not present

filter

The filter to evaluate