Class StateMachine<T>


  • public class StateMachine<T>
    extends Object
    Class to implement a StateMachine
    • Constructor Detail

      • StateMachine

        public StateMachine​(String id)
        Constructor
        Parameters:
        id - id
    • Method Detail

      • afterEach

        public StateMachine<T> afterEach​(StateMachine.Action<T> afterEachAction)
        Method to add an afterEach action
        Parameters:
        afterEachAction - afterEachAction
        Returns:
        this
      • define

        public StateMachine<T> define​(T source,
                                      StateMachine.Action<T> action,
                                      T... targets)
        Method to define a state, the action to perform, and possible target states
        Parameters:
        source - source
        action - action
        targets - targets
        Returns:
        this
      • end

        public StateMachine<T> end​(T end,
                                   StateMachine.Action<T> endAction)
        Method to set the end state and action
        Parameters:
        end - end
        endAction - endAction
        Returns:
        this