forked from p15670423/monkey
Common: Add IJSONSerializable interface
This commit is contained in:
parent
774b2c0116
commit
3958ad3e92
|
@ -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
|
Loading…
Reference in New Issue