Class StepList<StartInput>
java.lang.Object
io.superdurable.dex.StepList<StartInput>
- Type Parameters:
StartInput- the Flow's start input type
Declares a Flow's ordered collection of registered Steps.
The type parameter binds the Flow input to its start Step input. Use startStep(Step) for a
normally started Flow, withoutStartStep(Step...) for an RPC-started Flow, or empty() for a
Flow with no Steps. Add remaining Steps fluently with otherSteps(Step...).
public StepList<OrderInput> getSteps() {
return StepList.startStep(validate).otherSteps(charge, notifyCustomer);
}
-
Method Summary
Modifier and TypeMethodDescriptionstatic <StartInput>
StepList<StartInput> empty()Creates an empty Step list for a Flow with no Steps.otherSteps(Step<?>... steps) Returns a new list with additional non-start Steps.static <StartInput>
StepList<StartInput> Creates a Step list with a typed start Step.static <StartInput>
StepList<StartInput> withoutStartStep(Step<?>... steps) Creates a Step list with no start Step and one or more RPC-targetable Steps.
-
Method Details
-
empty
Creates an empty Step list for a Flow with no Steps.- Type Parameters:
StartInput- the declared Flow start input type- Returns:
- an empty immutable Step list
-
startStep
Creates a Step list with a typed start Step.- Type Parameters:
StartInput- the Flow and start-Step input type- Parameters:
startStep- the nonnull start Step whose input matches the Flow input- Returns:
- an immutable Step list containing the start Step
- Throws:
NullPointerException- ifstartStepisnull
-
withoutStartStep
Creates a Step list with no start Step and one or more RPC-targetable Steps.- Type Parameters:
StartInput- the declared Flow input type- Parameters:
steps- the nonnull non-start Steps- Returns:
- an immutable Step list without a start Step
- Throws:
NullPointerException- if the array or any Step isnull
-
otherSteps
Returns a new list with additional non-start Steps.- Parameters:
steps- the nonnull Steps to append- Returns:
- a new immutable Step list; the original list is unchanged
- Throws:
NullPointerException- if the array or any Step isnull
-