| 15602 | |
| 15603 | @functools.total_ordering |
| 15604 | class StructEmpty(object): |
| 15605 | def __init__(self): |
| 15606 | pass |
| 15607 | |
| 15608 | # Struct shallow copy |
| 15609 | def copy(self, other): |
| 15610 | return self |
| 15611 | |
| 15612 | # Struct deep clone |
| 15613 | def clone(self): |
| 15614 | # Serialize the struct to the FBE stream |
| 15615 | writer = StructEmptyModel(fbe.WriteBuffer()) |
| 15616 | writer.serialize(self) |
| 15617 | |
| 15618 | # Deserialize the struct from the FBE stream |
| 15619 | reader = StructEmptyModel(fbe.ReadBuffer()) |
| 15620 | reader.attach_buffer(writer.buffer) |
| 15621 | return reader.deserialize()[0] |
| 15622 | |
| 15623 | def __eq__(self, other): |
| 15624 | if not isinstance(self, other.__class__): |
| 15625 | return NotImplemented |
| 15626 | return True |
| 15627 | |
| 15628 | def __lt__(self, other): |
| 15629 | if not isinstance(self, other.__class__): |
| 15630 | return NotImplemented |
| 15631 | return False |
| 15632 | |
| 15633 | @property |
| 15634 | def __key__(self): |
| 15635 | return () |
| 15636 | |
| 15637 | def __hash__(self): |
| 15638 | return hash(self.__key__) |
| 15639 | |
| 15640 | def __format__(self, format_spec): |
| 15641 | return self.__str__() |
| 15642 | |
| 15643 | def __str__(self): |
| 15644 | sb = list() |
| 15645 | sb.append("StructEmpty(") |
| 15646 | sb.append(")") |
| 15647 | return "".join(sb) |
| 15648 | |
| 15649 | # Get struct JSON value |
| 15650 | def to_json(self): |
| 15651 | return json.dumps(self.__to_json__(), cls=fbe.JSONEncoder, separators=(',', ':')) |
| 15652 | |
| 15653 | def __to_json__(self): |
| 15654 | result = dict() |
| 15655 | result.update(dict( |
| 15656 | )) |
| 15657 | return result |
| 15658 | |
| 15659 | # Create struct from JSON value |
| 15660 | @staticmethod |
| 15661 | def from_json(document): |
no outgoing calls