Class StateHandler<T>


  • public class StateHandler<T>
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T call​(boolean isNew, T lastStateKey)
      Call the action function
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StateHandler

        public StateHandler​(@Nonnull
                            StateMachine<T> parent,
                            @Nonnull
                            java.util.function.Function<StateMetadata<T>,​T> action)
        Create a StateHandler for a given state
        Parameters:
        parent - The state machine that owns this object
        action - The action to be performed during this state
    • Method Detail

      • call

        public T call​(boolean isNew,
                      @Nullable
                      T lastStateKey)
        Call the action function
        Parameters:
        isNew - Is this the first run?
        lastStateKey - Key of the last state to run