open fun filter(@NonNull predicate: Predicate<in T>): Try<T>!
Returns a Failure
if this Try
represents a failed computation. Returns a Failure
if the value does not satisfy the predicate or an Exception
is thrown when testing the predicate. Returns Success
otherwise.
predicate
- Predicate<in T>: used to check the value.
Return
Try<T>!: a Try instance.
abstract fun filter(@NonNull predicate: Predicate<in T>, @NonNull supplier: Supplier<out Throwable!>): Try<T>!
Returns a Failure
if this Try
represents a failed computation. Returns a Failure
if the value does not satisfy the predicate or an Exception
is thrown with testing the predicate. Returns Success
otherwise.
Failure
will be taken from the given Supplier
.
predicate
- Predicate<in T>: used to check the value.
supplier
- Supplier<out Throwable!>: returns a Throwable
used if the value does not satisfy the predicate.