Constructor and Description |
---|
Builder(Class<S> klass,
S initialState,
S errorState)
State machine builder.
|
Modifier and Type | Method and Description |
---|---|
void |
addTransition(S source,
S target1,
S... targets)
Add arcs to the DAG.
|
StateMachine<S> |
build()
Create the state machine.
|
public Builder(@NonNull Class<S> klass, @NonNull S initialState, @Nullable S errorState)
klass
- The class of the enum of states.initialState
- The start state for the machine.errorState
- The machine error state.@SafeVarargs public final void addTransition(@NonNull S source, @NonNull S target1, @NonNull S... targets)
source
- of the arcs.target1
- the end of the first arctargets
- the ends of other arcspublic StateMachine<S> build()