public final class FailedOperationResult extends java.lang.Object implements OperationResult
OperationResult.Status
Modifier and Type | Field and Description |
---|---|
static OperationResult |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
OperationResult |
compose(java.util.function.Supplier<OperationResult> nextStep)
Creates new operation result that represents composition of two operation results.
|
OperationResult.Status |
getStatus() |
OperationResult |
otherwise(java.lang.Runnable runnable)
Adds fail callback to the operation result.
|
OperationResult |
then(java.lang.Runnable runnable)
Adds success callback to the operation result.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fail, success
public static final OperationResult INSTANCE
public OperationResult.Status getStatus()
getStatus
in interface OperationResult
public OperationResult compose(java.util.function.Supplier<OperationResult> nextStep)
OperationResult
compose
in interface OperationResult
nextStep
- the next operation result supplierpublic OperationResult then(java.lang.Runnable runnable)
OperationResult
then
in interface OperationResult
runnable
- callbackpublic OperationResult otherwise(java.lang.Runnable runnable)
OperationResult
otherwise
in interface OperationResult
runnable
- callbackpublic java.lang.String toString()
toString
in class java.lang.Object