public class Transition
extends java.lang.Object
Associated with a transition is code that is executed when the transition is taken.
| Constructor and Description |
|---|
Transition(java.lang.Object evtKey,
ProtocolState startState,
ProtocolState endState,
java.util.function.Function<Event,java.lang.Boolean> runBeforeTransition) |
Transition(java.lang.Object evtKey,
java.lang.String startState,
java.lang.String endState,
java.util.function.Function<Event,java.lang.Boolean> runBeforeTransition) |
Transition(java.lang.String eventName,
java.lang.String startState,
java.lang.String endState,
java.util.function.Function<Event,java.lang.Boolean> runBeforeTransition)
Creates a new transition.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doBeforeTransition(Event event)
Executes code associated with this transition.
|
public Transition(java.lang.String eventName,
java.lang.String startState,
java.lang.String endState,
java.util.function.Function<Event,java.lang.Boolean> runBeforeTransition)
eventName - the event triggering this transition.startState - the start state of this transition.endState - the end state of this transition.runBeforeTransition - code executed when the transition is triggered. If the callable
returns true, the transition takes place, if the callable returns false, the transition
will not take place and the FSM remains in startState.public Transition(java.lang.Object evtKey,
java.lang.String startState,
java.lang.String endState,
java.util.function.Function<Event,java.lang.Boolean> runBeforeTransition)
public Transition(java.lang.Object evtKey,
ProtocolState startState,
ProtocolState endState,
java.util.function.Function<Event,java.lang.Boolean> runBeforeTransition)
protected boolean doBeforeTransition(Event event)
This method returns the result of the executed Callable (true or false) or false in case of any Exceptions. No exceptions will be thrown from this method.