Class StateHandler<T>


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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void 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
                            T key,
                            @Nonnull
                            StateMachine<T> parent,
                            @Nonnull
                            java.util.function.Consumer<StateMetadata<T>> action)
        Create a StateHandler for a given state
        Parameters:
        key - The key for this state (it's name)
        parent - The state machine that owns this object
        action - The action to be performed during this state
    • Method Detail

      • call

        public void 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