Gemfire JavaDocs
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 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 operationdefault boolean
isSuccessful()
Returns a boolean to indicate the success or failure of the operation<T> T
map(java.util.function.Function<SuccessType,T> successFunction, java.util.function.Function<FailureType,T> errorFunction)
A mapping function that maps to eitherSuccessType
orFailureType
depending 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 eitherSuccessType
orFailureType
depending 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
-
-