public class FsmBuilder<S extends java.lang.Enum<S>,E>
extends java.lang.Object
| Constructor and Description |
|---|
FsmBuilder() |
FsmBuilder(java.util.concurrent.Executor executor,
java.lang.String loggerName) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTransition(Transition<S,E> transition)
Add a manually defined
Transition. |
void |
addTransitionAction(TransitionAction<S,E> transitionAction)
Add a manually defined
TransitionAction. |
Fsm<S,E> |
build(S initialState) |
ViaBuilder<S,E> |
onInternalTransition(S state)
Start defining an
Action that will be executed after an internal transition from/to state. |
ActionFromBuilder<S,E> |
onTransitionFrom(java.util.function.Predicate<S> filter)
Start defining an
Action that will execute after a transition from any state that passes filter. |
ActionFromBuilder<S,E> |
onTransitionFrom(S state)
Start defining an
Action that will execute after a transition from state. |
ActionToBuilder<S,E> |
onTransitionTo(java.util.function.Predicate<S> filter)
Start defining an
Action that will execute after a transition to any state that passes filter. |
ActionToBuilder<S,E> |
onTransitionTo(S state)
Start defining an
Action that will executed after a transition to state. |
TransitionBuilder<S,E> |
when(S state)
Start defining a
Transition from state state. |
public FsmBuilder()
public FsmBuilder(java.util.concurrent.Executor executor,
java.lang.String loggerName)
public TransitionBuilder<S,E> when(S state)
Transition from state state.state - the state the transition begins in.TransitionBuilder.public ViaBuilder<S,E> onInternalTransition(S state)
Action that will be executed after an internal transition from/to state.
The criteria for the event that causes this transition is defined on the returned ViaBuilder.
state - the state experiencing an internal transition.ViaBuilder.public ActionToBuilder<S,E> onTransitionTo(S state)
Action that will executed after a transition to state.
Further criteria for execution will be defined on the returned ActionToBuilder.
state - the state being transitioned to.ActionToBuilder.public ActionToBuilder<S,E> onTransitionTo(java.util.function.Predicate<S> filter)
Action that will execute after a transition to any state that passes filter.
Further criteria for execution will be defined on the returned ActionToBuilder.
filter - the filter for states being transitioned to.ActionToBuilder.public ActionFromBuilder<S,E> onTransitionFrom(S state)
Action that will execute after a transition from state.state - the state being transitioned from.ActionFromBuilder.public ActionFromBuilder<S,E> onTransitionFrom(java.util.function.Predicate<S> filter)
Action that will execute after a transition from any state that passes filter.filter - the filter for states being transitioned from.ActionFromBuilder.public void addTransition(Transition<S,E> transition)
Transition.transition - the Transition to add.public void addTransitionAction(TransitionAction<S,E> transitionAction)
TransitionAction.transitionAction - the TransitionAction to add.