Class Memento

java.lang.Object
Behavioral.Memento.Memento

public class Memento extends Object
The Memento class stores the state of the Originator.
  • Constructor Details

    • Memento

      public Memento(String state)
      Constructor to initialize the Memento with a state.
      Parameters:
      state - The state to save.
  • Method Details

    • getState

      public String getState()
      Retrieves the saved state.
      Returns:
      The saved state as a string.