Package io.hektor.fsm
Interface Transition<E,S extends Enum<S>,C extends Context,D extends Data>
- All Known Implementing Classes:
TransitionImpl
This interface represents the transition between two states.
When an event is processed by agiven
State, it will
match that event against all its Transitions and if one
matches, the FSM will transition fo the new state.
Note: in the current model, a Transition always live in
the context of a State and as such, there is no need to
keep track of the from state in this class (which is why only
getToState() exists)- Author:
- jonas@jonasborjesson.com
-
Method Summary
Modifier and TypeMethodDescriptionvoidacceptVisitor(FsmVisitor<S, C, D> visitor) Get the associated action wih this transition, if it exists.ThisTransitionrepresents the transition to this particular state.Get the transformation associated with thisTransition.booleanSee if the given event is matching this transition.
-
Method Details
-
match
See if the given event is matching this transition.- Parameters:
event- the event to match agianst this transition.- Returns:
- true if the event indeed matches, false otherwise.
-
getToState
S getToState()ThisTransitionrepresents the transition to this particular state. Assuming the event matches of course.- Returns:
- the to state
-
getGuardLabel
-
getAction
Get the associated action wih this transition, if it exists. -
getStatefulAction
-
getActionLabel
-
getEventType
-
getTransformation
Get the transformation associated with thisTransition. A transformation may only exists if this is a transition out of a transient state.- Returns:
- the optional transformation for a
Transitionout of a transient state.
-
getTransformationLabel
-
acceptVisitor
-