Interface Lifecycle<S extends State<S>>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void moveTo​(S state)
      Transition this lifecycle to a given state.
      S previous()
      Returns the state from which this lifecycle transitioned to its current state.
      S state()
      Returns the current state of this lifecycle.
      boolean tryMoveTo​(S state)
      Attempts to transition this lifecycle to a given state, but does not fail if the transition is illegal for this lifecycle.
    • Method Detail

      • previous

        S previous()
        Returns the state from which this lifecycle transitioned to its current state.
        Returns:
        the previous state
      • state

        S state()
        Returns the current state of this lifecycle.
        Returns:
        the current state.
      • moveTo

        void moveTo​(S state)
        Transition this lifecycle to a given state.
        Parameters:
        state - the state
        Throws:
        IllegalStateException - if the transition is illegal for this lifecycle
      • tryMoveTo

        boolean tryMoveTo​(S state)
        Attempts to transition this lifecycle to a given state, but does not fail if the transition is illegal for this lifecycle.
        Parameters:
        state - the state
        Returns:
        true if this lifecycle has transitioned to the given state