Package io.hektor.fsm

Interface TransitionListener<S extends Enum<S>>

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TransitionListener<S extends Enum<S>>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onTransition(S currentState, S toState, Object event)
    Will be invoked just before the Transition is executed by the FSM.
  • Method Details

    • onTransition

      void onTransition(S currentState, S toState, Object event)
      Will be invoked just before the Transition is executed by the FSM. If this method throws an exception, it will be ignored and the Transition will still be executed. However, if an exception is thrown, it will be logged on WARN and you really should check what on earth you are doing.
      Parameters:
      currentState - the state we are transitioning from, i.e. the current state.
      toState - the state we will be transitioning to, which could be the same as the current state.
      event - the event that triggere this transition.