| Modifier and Type | Class and Description |
|---|---|
static interface |
Checked.Function<A,B,E extends Exception>
Represents a
Checked.Function that may throw an exception. |
static interface |
Checked.Supplier<A,E extends Exception>
Represents a
Checked.Supplier that may throw an exception. |
| Modifier and Type | Method and Description |
|---|---|
static <A,E extends Exception> |
delay(Checked.Supplier<A,E> s)
Create a new delayed Try representing a delayed evaluation of a potentially
exception throwing operation.
|
static <A,B,E extends Exception> |
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.
|
static <A,B,E extends Exception> |
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,E extends Exception> |
now(Checked.Supplier<A,E> s)
Create a new Try representing the result of a potentially exception
throwing operation.
|
static <A,E extends Exception> |
of(Checked.Supplier<A,E> s)
Deprecated.
since 4.6 This is being replaced with
now(Supplier) to
make it clear that the supplier is evaluated immediately. If the evaluation
needs to be delayed, use delay(Supplier). |
public static <A,B,E extends Exception> Function<A,Try<B>> lift(Checked.Function<A,B,E> f)
A - the function argument typeB - the function return typeE - The type of exception potentially thrownf - a function that can throwpublic static <A,B,E extends Exception> Function<A,Try<B>> delayedLift(Checked.Function<A,B,E> f)
A - the function argument typeB - the function return typeE - The type of exception potentially thrownf - a function that can throw@Deprecated public static <A,E extends Exception> Try<A> of(Checked.Supplier<A,E> s)
now(Supplier) to
make it clear that the supplier is evaluated immediately. If the evaluation
needs to be delayed, use delay(Supplier).A - the type of value s suppliesE - The type of exception potentially throwns - a supplier that may throw an exceptionpublic static <A,E extends Exception> Try<A> now(Checked.Supplier<A,E> s)
A - the type of value s suppliesE - The type of exception potentially throwns - a supplier that may throw an exceptionpublic static <A,E extends Exception> Try<A> delay(Checked.Supplier<A,E> s)
A - the type of value s suppliesE - The type of exception potentially throwns - a supplier that may throw an exceptionCopyright © 2018 Atlassian. All rights reserved.