Kactoos

kactoos-jvm / nnl.rocks.kactoos.scalar / FirstOf

FirstOf

class FirstOf<T : Any> : Scalar<T>

Find first element in a list that satisfies specified condition.

There is no thread-safety guarantee.

Parameters

T - Type of result

condition - Condition for getting the element

source - Source iterable

fallback - Fallback used if no value matches

Since 0.4

Constructors

Name Summary
<init> FirstOf(condition: Func<T, Boolean>, source: Iterable<T>, fallback: Scalar<T>)
Find first element in a list that satisfies specified condition.

Functions

Name Summary
invoke fun invoke(): T
Get value of this Scalar