Class StateModel.State

  • All Implemented Interfaces:
    Action
    Enclosing class:
    StateModel<S extends Enum<S>>

    protected static class StateModel.State
    extends Object
    implements Action
    Inner class for state objects.
    • Constructor Detail

      • State

        protected State()
    • Method Detail

      • exec

        public void exec()
        Executes the state object by looking for a executable transition and executing the action of the first transition with a condition being fulfilled.
        Specified by:
        exec in interface Action
      • on

        public StateModel.State on​(BooleanSupplier cond,
                                   Action action)
        Adds a transition which triggers based on the given condition.
        Parameters:
        cond - the transition condition
        action - the transition action
        Returns:
        this state object