Package io.jmix.flowui.util
Interface OperationResult
- All Known Implementing Classes:
FailedOperationResult,SuccessOperationResult,UnknownOperationResult
public interface OperationResult
Operation result object.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumRepresents the possible statuses of anOperationResult. -
Method Summary
Modifier and TypeMethodDescriptioncompose(Supplier<OperationResult> nextStep) Creates new operation result that represents composition of two operation results.static OperationResultfail()Returns a predefinedOperationResultthat indicates a failed operation.Adds fail callback to the operation result.static OperationResultsuccess()Returns a predefinedOperationResultthat indicates a successful operation.Adds success callback to the operation result.
-
Method Details
-
fail
Returns a predefinedOperationResultthat indicates a failed operation.- Returns:
- an
OperationResultrepresenting failure
-
success
Returns a predefinedOperationResultthat indicates a successful operation.- Returns:
- an
OperationResultrepresenting success
-
getStatus
OperationResult.Status getStatus()- Returns:
- status of the operation
-
compose
Creates new operation result that represents composition of two operation results. If this result is resolved as successful, then the second result will be obtained from the passed supplier.- Parameters:
nextStep- the next operation result supplier- Returns:
- new composite operation result
-
then
Adds success callback to the operation result.- Parameters:
runnable- callback- Returns:
- this
-
otherwise
Adds fail callback to the operation result.- Parameters:
runnable- callback- Returns:
- this
-