kactoos-jvm / nnl.rocks.kactoos.scalar / FirstOf
class FirstOf<T : Any> : Scalar<T>
Find first element in a list that satisfies specified condition.
There is no thread-safety guarantee.
T - Type of result
condition - Condition for getting the element
source - Source iterable
fallback - Fallback used if no value matches
Since 0.4
| Name | Summary |
|---|---|
| <init> | FirstOf(condition: Func<T, Boolean>, source: Iterable<T>, fallback: Scalar<T>)Find first element in a list that satisfies specified condition. |
| Name | Summary |
|---|---|
| invoke | fun invoke(): TGet value of this Scalar |