Repository navigation
Expand file tree
/
Copy pathStateMachine.java
More file actions
35 lines (31 loc) · 1.53 KB
/
Copy pathStateMachine.java
File metadata and controls
35 lines (31 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package liquidjava.fsm;
import java.util.List;
/**
* Represents the state machine of one state set of a class
*
* @param stateSet the index of the state set among the class's StateSet annotations, in declaration order
* @param stateSetName the name given to the state set, or null if it has none
* @param entryTransitions always empty, see {@link StateMachineEntryTransition}
*/
public record StateMachine(
String className,
int stateSet,
String stateSetName,
List<String> states,
List<StateMachineTransition> transitions,
List<StateMachineInitialTransition> initialTransitions,
@Deprecated List<StateMachineEntryTransition> entryTransitions
) {
public StateMachine(String className, int stateSet, List<String> states, List<StateMachineTransition> transitions,
List<StateMachineInitialTransition> initialTransitions, List<StateMachineEntryTransition> entryTransitions) {
this(className, stateSet, null, states, transitions, initialTransitions, entryTransitions);
}
public StateMachine(String className, int stateSet, List<String> states, List<StateMachineTransition> transitions,
List<StateMachineInitialTransition> initialTransitions) {
this(className, stateSet, states, transitions, initialTransitions, List.of());
}
public StateMachine(String className, List<String> states, List<StateMachineTransition> transitions,
List<StateMachineInitialTransition> initialTransitions) {
this(className, 0, states, transitions, initialTransitions);
}
}