transition

fun <T : Enum<in T>> transition(currentState: State<in T>, event: Any): State<*>

A machine can have following scenarios :

  • No Parallel States + No Sub-Machine

  • Parallel States + No Sub-Machine

  • No Parallel States + Sub-Machine associated for Each/Some State (a Container (or) Non-Container Machine)

  • Parallel States + Sub-Machine associated for Each/Some State (a Container (or) Non-Container Machine)

Assumptions :

  • If passed State<*> object has in-sufficient info, assume initial values for those machines

  • If Passed State<*> object doesn't have proper hierarchy , assume insufficient info and process so that the returned object will be a completely formed state object

Passed State Object Assumptions :

  • the keys of the passed state reflect current StateMachine

  • the values(if non-empty) reflect state of sub-state machine associated with one of the State

Special Cases :

  • StateMachine with parallel state doesn't have any transition on their own but forward events to their parallel states submachine.