Class StateMachine<T extends Enum>
java.lang.Object
org.antublue.test.engine.internal.util.StateMachine<T>
- Type Parameters:
T- state type
Class to implement a StateMachine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanMethod to transition to a state if the current state doesn't matchbooleanMethod to transition to a state if the current state matchesvoidifTrueThenElse(boolean value, T trueState, T falseState) Method to check a boolean.name()Method to get the namevoidMethod to set the statestate()Method to get the statetoString()
-
Constructor Details
-
StateMachine
Constructor- Parameters:
name- name
-
-
Method Details
-
name
Method to get the name- Returns:
- the name
-
state
Method to get the state- Returns:
- the state
-
set
Method to set the state- Parameters:
state- the state
-
ifThen
Method to transition to a state if the current state matches- Parameters:
checkState- the state to checknextState- the next state- Returns:
- true if the transition occurs, else false
-
ifNotThen
Method to transition to a state if the current state doesn't match- Parameters:
checkState- the state to checknextState- the next state- Returns:
- true if the transition occurs, else false
-
ifTrueThenElse
Method to check a boolean. If true, transition to the first state, else transition to the second state- Parameters:
value- the value to checktrueState- the next state if the value is truefalseState- the next state if the value is false
-
toString
-