Class StateMachine<S>
java.lang.Object
org.antublue.test.engine.internal.statemachine.StateMachine<S>
Class to implement a StateMachine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddTransition(S state, Transition<S> transition) Method to add a state transitiongetId()Method to get the state machine idgetState()Method to get the current statevoidMethod start the state machinevoidMethod to set the statevoidstop()Method to stop the state machinevoidMethod to stop the state machinetoString()
-
Constructor Details
-
StateMachine
public StateMachine()Constructor -
StateMachine
Constructor- Parameters:
id- the state machine id
-
-
Method Details
-
addTransition
Method to add a state transition- Parameters:
state- the statetransition- the transition- Returns:
- this
-
getId
Method to get the state machine id- Returns:
- the state machine id
-
signal
Method to set the state- Parameters:
state- the state
-
run
Method start the state machine- Parameters:
state- the beginning state- Throws:
Throwable- an exception encountered when running
-
stop
public void stop()Method to stop the state machine -
stop
Method to stop the state machine- Parameters:
throwable- throwable
-
getState
Method to get the current state- Returns:
- the current state
-
toString
-