mirror of
https://github.com/rjNemo/design-patterns
synced 2026-06-06 02:26:40 +00:00
21 lines
437 B
Python
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
|