@NonNull static fun <T : Any!> getLast(@NonNull iterable: MutableIterable<T>): Try<T>
Returns Try
with last element of provided iterable or failure if iterable is empty.
@NonNull static fun <T : Any!> getLast(@NonNull iterable: MutableIterable<T>, @NonNull predicate: Predicate<T>): Try<T>
Tries to find last 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