Class StateMetadata<T>

  • Type Parameters:
    T - StateMachine's key datatype

    public class StateMetadata<T>
    extends java.lang.Object
    A container for metadata about a state. These are sent to every state's action consumer to provide information about how and when it is being called.
    • Constructor Summary

      Modifier Constructor Description
      protected StateMetadata​(StateMachine parent, T previousState, boolean isFirstRun)
      Create StateMetadata
    • Constructor Detail

      • StateMetadata

        protected StateMetadata​(@Nonnull
                                StateMachine parent,
                                T previousState,
                                boolean isFirstRun)
        Create StateMetadata
        parent - State's parent StateMachine
        previousState - The previous state key
        isFirstRun - Is this the first run of the action?
    • Method Detail

      • getPreviousStateKey

        public T getPreviousStateKey()
        Get the key of the last state to run. Null if this is the first state to be executed.
        Last key
      • isFirstRun

        public boolean isFirstRun()
        Is this the first loop of this action?
        Is first loop