Interface Try<V>
-
- All Known Implementing Classes:
Try.Failure,Try.Retriable,Try.Success
public interface Try<V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTry.Failure<V>static classTry.Retriable<V>static classTry.Success<V>
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static <V,E extends Throwable>
Try<V>failable(CheckedSupplier<V,E> supplier)static <V> Try<V>failure(Throwable t)<B> Try<B>flatMap(Function<? super V,Try<B>> mapper)Vget()ThrowablegetThrowable()booleanisFailure()booleanisSuccess()<B> Try<B>map(Function<? super V,? extends B> mapper)Try<V>recover(Function<? super Throwable,Try<V>> f)static <V,E extends Throwable>
Try.Retriable<V>retriable(CheckedSupplier<V,E> supplier, Retry retry)static <V> Try<V>success(V v)default Optional<V>toOptional()<U> Try<U>transform(Function<V,Try<U>> s, Function<Throwable,Try<U>> f)
-
-
-
Method Detail
-
retriable
static <V,E extends Throwable> Try.Retriable<V> retriable(CheckedSupplier<V,E> supplier, Retry retry)
-
failable
static <V,E extends Throwable> Try<V> failable(CheckedSupplier<V,E> supplier)
-
success
static <V> Try<V> success(V v)
-
get
V get()
-
isSuccess
boolean isSuccess()
-
isFailure
boolean isFailure()
-
getThrowable
Throwable getThrowable()
-
-