@FunctionalInterface public interface ComposableStep extends Step
Step with enhanced functionality facilitating the composition of step chains.| Modifier and Type | Field and Description |
|---|---|
static ComposableStep |
NO_OP
Step performing a no-OP; the implementation returns false indicating that no work was performed.
|
| Modifier and Type | Method and Description |
|---|---|
static ComposableStep |
composite(Step... components)
Returns a step that runs all given component steps; the
Step.perform() method of the resulting composite
step returns true if any of the component steps returns true. |
static ComposableStep |
create(Step step)
Returns a composable step given a "normal" step.
|
default ComposableStep |
then(Step next)
Returns a composable step that performs first this and then the next step.
|
default ComposableStep |
thenIfNotPerformed(Step next)
Returns a composable step that performs first this step and then the next step
only if the first performed no work as indicated by result of the
Step.perform() invocation. |
default ComposableStep |
thenIfPerformed(Step next)
Returns a composable step that performs first this step and then the next step
only if the first performed any work as indicated by result of the
Step.perform() invocation. |
static final ComposableStep NO_OP
default ComposableStep then(Step next)
The procedure eliminates no-OP steps, i.e. it returns this if
(next == NO_OP).
next - the next step to be performed after thisdefault ComposableStep thenIfPerformed(Step next)
Step.perform() invocation.
The procedure eliminates no-OP steps, i.e. it returns this if
(next == NO_OP).
next - the next step to be performed after this only if it performed some workdefault ComposableStep thenIfNotPerformed(Step next)
Step.perform() invocation.
The procedure eliminates no-OP steps, i.e. it returns this if
(next == NO_OP).
next - the next step to be performed after this only if it performed no workstatic ComposableStep create(Step step)
The procedure preserves no-OP steps as well as existing instances of ComposableStep,
which means that such values are returned unchanged.
step - the step to be wrapped as a ComposableStepComposableStep doing exactly the same work as step but with a richer interface
for step copositionstatic ComposableStep composite(Step... components)
Step.perform() method of the resulting composite
step returns true if any of the component steps returns true. The procedure uses then(Step) for the
composition and eliminates no-OP components.components - the component steps forming the parts of the returned stepNO_OP