public class StateMachineBuilder<S,E,C>
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
StateMachine<S,E,C> |
build(S initial)
Builds a state machine with the transitions and states configured by the builder.
|
StateMachineTemplate<S,E,C> |
buildTransitionModel()
Builds a state machine template capable of creating many instances all sharing the same
state transitions and actions but all with their own current state.
|
static <S,E,C> StateMachineBuilder<S,E,C> |
create(java.lang.Class<S> stateClass,
java.lang.Class<E> eventClass) |
StateMachineBuilder<S,E,C> |
defaultContext(C defaultContext) |
EntryExit<S,E,C> |
onEntry(S state) |
EntryExit<S,E,C> |
onExit(S state) |
Transition<S,E,C> |
transition() |
public static <S,E,C> StateMachineBuilder<S,E,C> create(java.lang.Class<S> stateClass, java.lang.Class<E> eventClass)
public Transition<S,E,C> transition()
public StateMachineBuilder<S,E,C> defaultContext(C defaultContext)
public StateMachine<S,E,C> build(S initial)
initial - the state the machine will be in when createdjava.lang.IllegalArgumentException - if the initial state is nullpublic StateMachineTemplate<S,E,C> buildTransitionModel()