Finite State Machine in Kotlin
This release adds support for typed parameters and return-types. All events will only receive one optional parameter of the same type and an optional return value all the same type.
This build renames a few DSL functions and will break existing code.
state
-> whenState
transition
-> onEvent
entry
-> onEntry
exit
-> onExit
pushTransition
-> onEventPush
popTransition
-> onEventPop
initial
-> initialState
initialMap
-> initialStates
Previously state machine events had to be an enum class. This restriction has now been removed. The constructor of the builder does not require a set of valid events of the specific type. The events will be stored in sets or be used as keys in maps, they require correct implementations of equals and hashCode. Enums, primitive types and data classes are all good candidates.
The documentation has been updated with a packet reader example.
Files moved and companion objects moved. File renamed.
This release includes the following:
The following features have been added:
Improve the DSL by rename on
to transition