| Modifier and Type | Interface and Description |
|---|---|
static class |
Try.Failure<T>
Failure implementation
|
static class |
Try.Success<T>
Success implementation
|
| Modifier and Type | Method and Description |
|---|---|
default <R> R |
apply(java.util.function.Function<HK<Try,T,Try<T>>,R> f) |
static <T> Try<T> |
failure(Throwable value) |
default Try<T> |
filter(java.util.function.Predicate<? super T> predicate)
Method called when the current data must be filtered using a given predicate.
|
<B> Try<B> |
flatmap(java.util.function.Function<? super T,Try<B>> mapper) |
default <B> B |
fold(java.util.function.Function<? super T,B> success,
java.util.function.Function<? super Throwable,B> failure) |
default boolean |
isSuccess() |
default <B> Try<B> |
map(java.util.function.Function<? super T,? extends B> mapper) |
Try<T> |
onFailure(java.util.function.Consumer<? super Throwable> onFailure) |
Try<T> |
onSuccess(java.util.function.Consumer<? super T> onSuccess) |
default T |
orElseThrow() |
<X extends Throwable> |
orElseThrow(java.util.function.Function<? super Throwable,? extends X> exceptionSupplier) |
default <X extends Throwable> |
orElseThrow(java.util.function.Supplier<? extends X> exceptionSupplier) |
T |
recoverWith(java.util.function.Function<? super Throwable,T> t) |
default T |
recoverWith(T t) |
default Try<T> |
self() |
static <T> Try<T> |
success(T value) |
static <T> Try<T> success(T value)
default Try<T> filter(java.util.function.Predicate<? super T> predicate)
Filterdefault <B> Try<B> map(java.util.function.Function<? super T,? extends B> mapper)
default <B> B fold(java.util.function.Function<? super T,B> success, java.util.function.Function<? super Throwable,B> failure)
default <X extends Throwable> T orElseThrow(java.util.function.Supplier<? extends X> exceptionSupplier) throws X extends Throwable
X extends Throwabledefault boolean isSuccess()
T recoverWith(java.util.function.Function<? super Throwable,T> t)
<X extends Throwable> T orElseThrow(java.util.function.Function<? super Throwable,? extends X> exceptionSupplier) throws X extends Throwable
X extends Throwable<B> Try<B> flatmap(java.util.function.Function<? super T,Try<B>> mapper)
Try<T> onSuccess(java.util.function.Consumer<? super T> onSuccess)
Try<T> onFailure(java.util.function.Consumer<? super Throwable> onFailure)
Copyright © 2020. All rights reserved.