Interface State

All Known Implementing Classes:
ConcreteStateA, ConcreteStateB

public interface State
Abstract State interface defining behavior for concrete states.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the name of the current state for debugging purposes.
    void
    handle(Context context)
    Handles the context-specific behavior for this state.
  • Method Details

    • handle

      void handle(Context context)
      Handles the context-specific behavior for this state.
      Parameters:
      context - The context object whose state is being handled.
    • getName

      String getName()
      Gets the name of the current state for debugging purposes.
      Returns:
      The name of the state.