VMware GemFire Java API Reference
Package org.apache.geode.services.result
Interface Result<SuccessType,FailureType>
-
- Type Parameters:
SuccessType- the return type in the event of operational successFailureType- the return type in the event of operational failure
- All Known Subinterfaces:
ServiceResult<SuccessType>
@Experimental public interface Result<SuccessType,FailureType>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description FailureTypegetErrorMessage()The return message of a failed operation.SuccessTypegetMessage()The return message of a successful operation.default booleanisFailure()Returns a boolean to indicate the success or failure of the operationdefault booleanisSuccessful()Returns a boolean to indicate the success or failure of the operation<T> Tmap(java.util.function.Function<SuccessType,T> successFunction, java.util.function.Function<FailureType,T> errorFunction)A mapping function that maps to eitherSuccessTypeorFailureTypedepending on success or failure of the operation.
-
-
-
Method Detail
-
map
<T> T map(java.util.function.Function<SuccessType,T> successFunction, java.util.function.Function<FailureType,T> errorFunction)
A mapping function that maps to eitherSuccessTypeorFailureTypedepending on success or failure of the operation.- Type Parameters:
T- the resultant type- Parameters:
successFunction- the mapping function to map the SuccessType to the resultant typeerrorFunction- the mapping function to map the FailureType to the resultant error type- Returns:
- result of type
T
-
getMessage
SuccessType getMessage()
The return message of a successful operation. The return type is of typeSuccessType- Returns:
- the result of the operation
-
getErrorMessage
FailureType getErrorMessage()
The return message of a failed operation. The return type is of typeFailureType- Returns:
- the failure message of why the operation did not succeed.
-
isSuccessful
default boolean isSuccessful()
Returns a boolean to indicate the success or failure of the operation- Returns:
- true indicating the success of the operation
-
isFailure
default boolean isFailure()
Returns a boolean to indicate the success or failure of the operation- Returns:
- true indicating the failure of the operation
-
-