sdk-common / com.tomtom.online.sdk.common.functional.collections / Lists / findFirst

findFirst

static fun <A : Any!> findFirst(@NonNull list: MutableList<A>, @NonNull predicate: Predicate<in A>): Try<A>!

Tries to find first List value that satisfies the given predicate.

Parameters

list - MutableList<A>: list of values that are going to be checked

predicate - Predicate<in A>: predicate used for checking

- value type

Return
Try<A>!: Success if a value is found, Failure otherwise