Common: Add IJSONSerializable interface

This commit is contained in:
vakarisz 2022-07-12 11:27:17 +03:00
parent 774b2c0116
commit 3958ad3e92
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
from __future__ import annotations
from abc import ABC, abstractmethod
class IJSONSerializable(ABC):
@classmethod
@abstractmethod
def from_json(cls, json_string: str) -> IJSONSerializable:
pass
@classmethod
@abstractmethod
def to_json(cls, class_object: IJSONSerializable) -> str:
pass