Interface MementoSupport


public interface MementoSupport
An interface that marks an object as one supporting the memento pattern.
Author:
Jan Ortmann
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new memento that holds the object's current state.
    void
    setState(Memento memento)
    Sets the object's state to the one stored in the memento.
  • Method Details

    • newMemento

      Memento newMemento()
      Creates a new memento that holds the object's current state.
    • setState

      void setState(Memento memento)
      Sets the object's state to the one stored in the memento.
      Throws:
      IllegalArgumentException - if the memento does not contain this object's state.