design-patterns/behavioral/memento/memento.py
2020-10-03 20:44:57 +02:00

21 lines
437 B
Python

from abc import ABC, abstractmethod
class Memento(ABC):
"""
The Memento interface provides a way to retrieve the memento's metadata,
such as creation date or name. However, it doesn't expose the Originator's
state.
"""
@abstractmethod
def get_state(self) -> str:
pass
@abstractmethod
def get_name(self) -> str:
pass
@abstractmethod
def get_date(self) -> str:
pass