What is jDFA?
jDFA is an Event-Based Deterministic Finite Automaton implementation in Java.
jDFA is inspired from Erlang design principles which describe a Finite State Machine as a set of relations of the form :
State(S) x Event(E) -> Actions(A), State(S')
These relations are interpreted as meaning :
If we are in state S and the event E occurs, we should perform the actions A and make a transition to the state S'.
Using jDFA, you can define FSM transitions with an intuitive API like :
Transition t = new TransitionBuilder() .sourceState(s0) //if we are in state s0 .eventType(Event.class) // and the event E occurs .eventHandler(myAction) // we should perform the actions A .targetState(s1) // and make a transition to the state s1 .build();
All jDFA documentation can be found here : https://github.com/benas/jDFA/wiki
jDFA is released under the MIT License.