Package com.alibaba.cola.statemachine
Interface StateMachine<S,E,C>
-
- Type Parameters:
S- the type of stateE- the type of eventC- the user defined context
- All Superinterfaces:
Visitable
- All Known Implementing Classes:
StateMachineImpl
public interface StateMachine<S,E,C> extends Visitable
StateMachine- Author:
- Frank Zhang
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SfireEvent(S sourceState, E event, C ctx)Send an eventEto the state machine.StringgeneratePlantUML()StringgetMachineId()MachineId is the identifier for a State MachinevoidshowStateMachine()Use visitor pattern to display the structure of the state machine
-
-
-
Method Detail
-
fireEvent
S fireEvent(S sourceState, E event, C ctx)
Send an eventEto the state machine.- Parameters:
sourceState- the source stateevent- the event to sendctx- the user defined context- Returns:
- the target state
-
getMachineId
String getMachineId()
MachineId is the identifier for a State Machine- Returns:
-
showStateMachine
void showStateMachine()
Use visitor pattern to display the structure of the state machine
-
generatePlantUML
String generatePlantUML()
-
-