public interface Result<A>
| Modifier and Type | Interface and Description |
|---|---|
static class |
Result.Failure<A> |
static class |
Result.Success<A> |
| Modifier and Type | Method and Description |
|---|---|
default java.util.Optional<A> |
asOptional() |
static <A> Result<A> |
failure(java.lang.Throwable failure) |
default <B> Result<B> |
flatMap(java.util.function.Function<A,Result<B>> f) |
static <A> Result<A> |
fromOptional(java.util.Optional<A> opt,
java.util.function.Supplier<java.lang.Throwable> f) |
default A |
get() |
default java.util.Optional<java.lang.Throwable> |
getFailure() |
default A |
getOrElse(A elseValue) |
default A |
getOrThrow() |
default boolean |
isSuccess() |
default <B> Result<B> |
map(java.util.function.Function<A,B> f) |
static <A> Result<A> |
success(A a) |
static <A> Result<A> success(A a)
static <A> Result<A> failure(java.lang.Throwable failure)
static <A> Result<A> fromOptional(java.util.Optional<A> opt, java.util.function.Supplier<java.lang.Throwable> f)
default A get()
default A getOrThrow()
default java.util.Optional<java.lang.Throwable> getFailure()
default boolean isSuccess()
default java.util.Optional<A> asOptional()