| 735 | |
| 736 | |
| 737 | class ObjDictTools: |
| 738 | @staticmethod |
| 739 | def as_obj(dict: Dict) -> object: |
| 740 | result = ObjDictTools() |
| 741 | result.__dict__ = dict |
| 742 | return result |
| 743 | |
| 744 | @staticmethod |
| 745 | def as_dict(obj: object) -> Dict: |
| 746 | return obj.__dict__ |
| 747 | |
| 748 | @staticmethod |
| 749 | def to_obj(dict: Dict) -> object: |
| 750 | result = ObjDictTools() |
| 751 | result.__dict__.update(dict) |
| 752 | return result |
| 753 | |
| 754 | @staticmethod |
| 755 | def to_dict(obj: object) -> Dict: |
| 756 | return obj.__dict__.copy() |