public class ExecutionResultWrapper extends Object implements IExecutionResult
IExecutionResult
to redirect everything to
the original result.Constructor and Description |
---|
ExecutionResultWrapper(IExecutionResult result) |
Modifier and Type | Method and Description |
---|---|
static IExecutionResult |
combine(IExecutionResult states,
IExecutionResult returnedValueAndDirective)
Easy way to combine states and [return value and/or directive]
|
static IExecutionResult |
combineIgnoringDirective(IExecutionResult states,
IExecutionResult returnedValue)
Easy way to combine states and return value if present
|
ExecutionResultState |
getActionValidated()
If this executable contains sub-executables, returns
ExecutionResultState.OK if they are correctly executed. |
ExecutionResultState |
getConditionValidated()
If this executable contains conditions, returns
ExecutionResultState.OK if they are validated, ExecutionResultState.KO if not. |
IExecutionControlDirective |
getDirective()
Returns the directive to transmit to parent
IExecutable , so that they can make appropriate actions. |
IExecutionResult |
getResult() |
Object |
getReturnedValue()
Any executable may return a value.
|
boolean |
isContainingDirective()
Tells if this result contains flow control directives, in which case in should be interpreted.
|
static IExecutionResult |
wrapForDirective(IExecutionResult result,
IExecutionControlDirective directive)
Easy way to wrap a result with a directive
|
static IExecutionResult |
wrapForDirectiveAndReturnedValue(IExecutionResult result,
Object returnedValue,
IExecutionControlDirective directive)
Easy way to wrap a result with a return value and a directive
|
static IExecutionResult |
wrapForReturnedValue(IExecutionResult result,
Object returnedValue)
Easy way to wrap a result with a return value
|
public ExecutionResultWrapper(IExecutionResult result)
public ExecutionResultState getConditionValidated()
IExecutionResult
ExecutionResultState.OK
if they are validated, ExecutionResultState.KO
if not.ExecutionResultState.NA
.ExecutionResultState.PARTIAL
.getConditionValidated
in interface IExecutionResult
public ExecutionResultState getActionValidated()
IExecutionResult
ExecutionResultState.OK
if they are correctly executed.ExecutionResultState.KO
if not.ExecutionResultState.PARTIAL
if some are correctly executed, others not.ExecutionResultState.NA
.IAction
)
will only return ExecutionResultState.OK
, as errors are handled via Exceptions.IExecutable
will handle correctly all types of results.getActionValidated
in interface IExecutionResult
public boolean isContainingDirective()
IExecutionResult
IExecutionResult.getDirective()
can't return null.isContainingDirective
in interface IExecutionResult
public IExecutionControlDirective getDirective()
IExecutionResult
IExecutable
, so that they can make appropriate actions.IExecutionResult.isContainingDirective()
is true.getDirective
in interface IExecutionResult
public Object getReturnedValue()
IExecutionResult
getReturnedValue
in interface IExecutionResult
public IExecutionResult getResult()
public static IExecutionResult wrapForReturnedValue(IExecutionResult result, Object returnedValue)
public static IExecutionResult wrapForDirective(IExecutionResult result, IExecutionControlDirective directive)
public static IExecutionResult wrapForDirectiveAndReturnedValue(IExecutionResult result, Object returnedValue, IExecutionControlDirective directive)
public static IExecutionResult combineIgnoringDirective(IExecutionResult states, IExecutionResult returnedValue)
public static IExecutionResult combine(IExecutionResult states, IExecutionResult returnedValueAndDirective)