@NonNull static fun <T : Any!> getFirst(@NonNull iterable: MutableIterable<T>): Try<T>
Returns Try.Success
with first element of provided iterable or failure if iterable is empty.
static fun <T : Any!> getFirst(@NonNull iterable: MutableIterable<T>, @NonNull predicate: Predicate<T>): Try<T>!
Tries to find first Iterable element that satisfies the given predicate.
iterable
- MutableIterable<T>: iterable of values that are going to be checked
predicate
- Predicate<T>: predicate used for checking
Return
Try<T>!: Success if a value is found, Failure otherwise