Try<A> |
Try.catchError(Fn1<? super java.lang.Throwable,? extends Monad<A,Try<?>>> recoveryFn) |
Catch any thrown errors inside the Monad and resume normal
operations.
|
Try<A> |
Try.catching(Fn1<? super java.lang.Throwable,? extends java.lang.Boolean> predicate,
Fn1<? super java.lang.Throwable,? extends A> recoveryFn) |
Catch any thrown T satisfying predicate and map it to a success value.
|
<S extends java.lang.Throwable> Try<A> |
Try.catching(java.lang.Class<S> throwableType,
Fn1<? super S,? extends A> recoveryFn) |
Catch any instance of throwableType and map it to a success value.
|
<B> Try<B> |
Try.discardL(Applicative<B,Try<?>> appB) |
Sequence both this Applicative and appB , discarding this Applicative's
result and returning appB .
|
<B> Try<A> |
Try.discardR(Applicative<B,Try<?>> appB) |
Sequence both this Applicative and appB , discarding appB's result and
returning this Applicative .
|
Try<A> |
Try.ensuring(SideEffect sideEffect) |
Run the provided runnable regardless of whether this is a success or a failure (the Try analog to
finally .
|
static <A> Try<A> |
Try.failure(java.lang.Throwable t) |
Static factory method for creating a failure value.
|
<B> Try<B> |
Try.flatMap(Fn1<? super A,? extends Monad<B,Try<?>>> f) |
Chain dependent computations that may continue or short-circuit based on previous results.
|
<B> Try<B> |
Try.fmap(Fn1<? super A,? extends B> fn) |
Covariantly transmute this functor's parameter using the given mapping function.
|
<B> Try<B> |
Try.pure(B b) |
Lift the value b into this applicative functor.
|
static <A> Try<A> |
Try.success(A a) |
Static factory method for creating a success value.
|
Try<A> |
Try.throwError(java.lang.Throwable throwable) |
Throw an error value of type E into the monad .
|
<B> Try<B> |
Try.trampolineM(Fn1<? super A,? extends MonadRec<RecursiveResult<A,B>,Try<?>>> fn) |
|
static <A> Try<A> |
Try.trying(Fn0<? extends A> supplier) |
Execute supplier , returning a success A or a failure of the thrown Throwable .
|
static Try<Unit> |
Try.trying(SideEffect sideEffect) |
Execute runnable , returning a success Unit or a failure of the thrown Throwable .
|
static <A extends java.lang.AutoCloseable,B extends java.lang.AutoCloseable,C extends java.lang.AutoCloseable,D> Try<D> |
Try.withResources(Fn0<? extends A> fn0,
Fn1<? super A,? extends B> bFn,
Fn1<? super B,? extends C> cFn,
Fn1<? super C,? extends Try<? extends D>> fn) |
Convenience overload of withResources that
cascades
two dependent resource creations via nested calls.
|
static <A extends java.lang.AutoCloseable,B extends java.lang.AutoCloseable,C> Try<C> |
Try.withResources(Fn0<? extends A> fn0,
Fn1<? super A,? extends B> bFn,
Fn1<? super B,? extends Try<? extends C>> fn) |
Convenience overload of withResources that cascades dependent resource
creation via nested calls.
|
static <A extends java.lang.AutoCloseable,B> Try<B> |
Try.withResources(Fn0<? extends A> fn0,
Fn1<? super A,? extends Try<? extends B>> fn) |
Given a Fn0 <AutoCloseable > aSupplier and an Fn1
fn , apply fn to the result of aSupplier , ensuring that the result has its
close method invoked, regardless of the outcome.
|
<B> Try<B> |
Try.zip(Applicative<Fn1<? super A,? extends B>,Try<?>> appFn) |
Given another instance of this applicative over a mapping function, "zip" the two instances together using
whatever application semantics the current applicative supports.
|