T - type of result valuepublic interface Result<T>
| Modifier and Type | Interface and Description |
|---|---|
static class |
Result.Error<V> |
static class |
Result.Fail<V> |
static class |
Result.Success<V> |
static class |
Result.Unexpected<V> |
| Modifier and Type | Method and Description |
|---|---|
static <V> Result<V> |
error(String message,
Throwable throwable) |
static <V> Result<V> |
fail(Status status) |
static <V> Result<V> |
fail(UnexpectedResultException unexpected) |
Status |
getStatus() |
T |
getValue() |
default boolean |
isSuccess() |
<U> Result<U> |
map(Function<T,U> mapper) |
static <V> Result<V> |
success(V value) |
static <V> Result<V> |
success(V value,
Status status) |
@Nonnull T getValue() throws UnexpectedResultException
UnexpectedResultExceptiondefault boolean isSuccess()
static <V> Result<V> fail(UnexpectedResultException unexpected)
Copyright © 2023. All rights reserved.