SuccessType - the return type in the event of operational successFailureType - the return type in the event of operational failure@Experimental public interface Result<SuccessType,FailureType>
| Modifier and Type | Method and Description |
|---|---|
FailureType |
getErrorMessage()
The return message of a failed operation.
|
SuccessType |
getMessage()
The return message of a successful operation.
|
default boolean |
isFailure()
Returns a boolean to indicate the success or failure of the operation
|
default boolean |
isSuccessful()
Returns a boolean to indicate the success or failure of the operation
|
<T> T |
map(Function<SuccessType,T> successFunction,
Function<FailureType,T> errorFunction)
A mapping function that maps to either
SuccessType or FailureType depending on
success or
failure of the operation. |
<T> T map(Function<SuccessType,T> successFunction, Function<FailureType,T> errorFunction)
SuccessType or FailureType depending on
success or
failure of the operation.T - the resultant typesuccessFunction - the mapping function to map the SuccessType to the resultant typeerrorFunction - the mapping function to map the FailureType to the resultant error typeTSuccessType getMessage()
SuccessTypeFailureType getErrorMessage()
FailureTypedefault boolean isSuccessful()
default boolean isFailure()