| Package | Description |
|---|---|
| io.atlassian.fugue |
| Modifier and Type | Method and Description |
|---|---|
default Try<A> |
Checked.Supplier.attempt() |
static <A,E extends Exception> |
Checked.delay(Checked.Supplier<A,E> s)
Create a new delayed Try representing a delayed evaluation of a potentially
exception throwing operation.
|
static <A> Try<A> |
Try.delayed(Supplier<Try<A>> supplier)
Creates a delayed Try, which will return either a Failure or a Success when
evaluated.
|
static <A> Try<A> |
Try.failure(Exception e)
Creates a new failure
|
abstract Try<A> |
Try.filterOrElse(Predicate<? super A> p,
Supplier<Exception> orElseSupplier)
Return a
Success if this is a Success and the
contained values satisfies the given predicate. |
abstract <B> Try<B> |
Try.flatMap(Function<? super A,Try<B>> f)
Binds the given function across the success value if it is one.
|
static <A> Try<A> |
Try.flatten(Try<Try<A>> t)
Reduces a nested Try by a single level
|
abstract <B> Try<B> |
Try.map(Function<? super A,? extends B> f)
Maps the given function to the value from this `Success` or returns this
unchanged if a `Failure`.
|
static <A,E extends Exception> |
Checked.now(Checked.Supplier<A,E> s)
Create a new Try representing the result of a potentially exception
throwing operation.
|
static <A,E extends Exception> |
Checked.of(Checked.Supplier<A,E> s)
Deprecated.
since 4.6 This is being replaced with
Checked.now(Supplier) to
make it clear that the supplier is evaluated immediately. If the evaluation
needs to be delayed, use Checked.delay(Supplier). |
abstract Try<A> |
Try.orElse(Supplier<? extends Try<? extends A>> orElse)
If this is a success, return the same success.
|
Try<A> |
Try.orElse(Try<? extends A> orElse)
If this is a success, return the same success.
|
abstract <X extends Exception> |
Try.recover(Class<X> exceptionType,
Function<? super X,A> f)
Applies the given function `f` if this is a `Failure` with certain
exception type otherwise leaves this unchanged.
|
abstract Try<A> |
Try.recover(Function<? super Exception,A> f)
Applies the given function `f` if this is a `Failure` otherwise this
unchanged if a 'Success'.
|
abstract <X extends Exception> |
Try.recoverWith(Class<X> exceptionType,
Function<? super X,Try<A>> f)
Binds the given function across certain exception type if it is one,
otherwise this unchanged.
|
abstract Try<A> |
Try.recoverWith(Function<? super Exception,Try<A>> f)
Binds the given function across the failure value if it is one, otherwise
this unchanged if a 'Success'.
|
static <A> Try<Iterable<A>> |
Try.sequence(Iterable<Try<A>> trys)
Returns a success wrapping all of the values if all of the arguments were a
success, otherwise this returns the first failure
|
static <T,A,R> Try<R> |
Try.sequence(Iterable<Try<T>> trys,
Collector<T,A,R> collector)
Returns a success wrapping all of the values if all of the arguments were a
success, otherwise this returns the first failure
|
static <A> Try<A> |
Try.successful(A value)
Creates a new Success
|
| Modifier and Type | Method and Description |
|---|---|
static <A,B,E extends Exception> |
Checked.delayedLift(Checked.Function<A,B,E> f)
Lifts a function that potentially throws into a function that either
returns a delayed Try, which, when evaluated, returns a Success of the
result or a failure containing the thrown exception.
|
default Function<A,Try<B>> |
Checked.Function.lift() |
static <A,B,E extends Exception> |
Checked.lift(Checked.Function<A,B,E> f)
Lifts a function that potentially throws into a function that either
returns a Success of the value or a failure containing the thrown
exception.
|
static <A> Collector<Try<A>,?,Try<List<A>>> |
FugueCollectors.toTrySuccess()
Collect the right values if there are only successes, otherwise return the
first failure encountered.
|
static <A> Collector<Try<A>,?,Try<List<A>>> |
FugueCollectors.toTrySuccess()
Collect the right values if there are only successes, otherwise return the
first failure encountered.
|
static <A,B,C> Collector<Try<A>,?,Try<C>> |
FugueCollectors.toTrySuccess(Collector<A,B,C> aCollector)
Collect the right values if there are only successes, otherwise return the
first failure encountered.
|
static <A,B,C> Collector<Try<A>,?,Try<C>> |
FugueCollectors.toTrySuccess(Collector<A,B,C> aCollector)
Collect the right values if there are only successes, otherwise return the
first failure encountered.
|
| Modifier and Type | Method and Description |
|---|---|
static <A> Try<A> |
Try.flatten(Try<Try<A>> t)
Reduces a nested Try by a single level
|
Try<A> |
Try.orElse(Try<? extends A> orElse)
If this is a success, return the same success.
|
| Modifier and Type | Method and Description |
|---|---|
static <A> Try<A> |
Try.delayed(Supplier<Try<A>> supplier)
Creates a delayed Try, which will return either a Failure or a Success when
evaluated.
|
abstract <B> Try<B> |
Try.flatMap(Function<? super A,Try<B>> f)
Binds the given function across the success value if it is one.
|
static <A> Try<A> |
Try.flatten(Try<Try<A>> t)
Reduces a nested Try by a single level
|
abstract Try<A> |
Try.orElse(Supplier<? extends Try<? extends A>> orElse)
If this is a success, return the same success.
|
abstract <X extends Exception> |
Try.recoverWith(Class<X> exceptionType,
Function<? super X,Try<A>> f)
Binds the given function across certain exception type if it is one,
otherwise this unchanged.
|
abstract Try<A> |
Try.recoverWith(Function<? super Exception,Try<A>> f)
Binds the given function across the failure value if it is one, otherwise
this unchanged if a 'Success'.
|
static <A> Try<Iterable<A>> |
Try.sequence(Iterable<Try<A>> trys)
Returns a success wrapping all of the values if all of the arguments were a
success, otherwise this returns the first failure
|
static <T,A,R> Try<R> |
Try.sequence(Iterable<Try<T>> trys,
Collector<T,A,R> collector)
Returns a success wrapping all of the values if all of the arguments were a
success, otherwise this returns the first failure
|
Copyright © 2018 Atlassian. All rights reserved.