MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / BalanceMessage

Class BalanceMessage

projects/Python/proto/proto.py:2891–2972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2889
2890@functools.total_ordering
2891class BalanceMessage(object):
2892 __slots__ = "body",
2893
2894 def __init__(self, body=None):
2895 if body is None:
2896 body = Balance()
2897 self.body = body
2898
2899 # Struct shallow copy
2900 def copy(self, other):
2901 self.body = other.body
2902 return self
2903
2904 # Struct deep clone
2905 def clone(self):
2906 # Serialize the struct to the FBE stream
2907 writer = BalanceMessageModel(fbe.WriteBuffer())
2908 writer.serialize(self)
2909
2910 # Deserialize the struct from the FBE stream
2911 reader = BalanceMessageModel(fbe.ReadBuffer())
2912 reader.attach_buffer(writer.buffer)
2913 return reader.deserialize()[0]
2914
2915 def __eq__(self, other):
2916 if not isinstance(self, other.__class__):
2917 return NotImplemented
2918 return True
2919
2920 def __lt__(self, other):
2921 if not isinstance(self, other.__class__):
2922 return NotImplemented
2923 return False
2924
2925 @property
2926 def __key__(self):
2927 return ()
2928
2929 def __hash__(self):
2930 return hash(self.__key__)
2931
2932 def __format__(self, format_spec):
2933 return self.__str__()
2934
2935 def __str__(self):
2936 sb = list()
2937 sb.append("BalanceMessage(")
2938 sb.append("body=")
2939 sb.append(str(self.body))
2940 sb.append(")")
2941 return "".join(sb)
2942
2943 # Get struct JSON value
2944 def to_json(self):
2945 return json.dumps(self.__to_json__(), cls=fbe.JSONEncoder, separators=(',', ':'))
2946
2947 def __to_json__(self):
2948 result = dict()

Callers 7

__from_json__Method · 0.70
getMethod · 0.70
deserializeMethod · 0.70
getMethod · 0.70
deserializeMethod · 0.70
__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected