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

Class EnumInt32

projects/Python/proto/enums.py:775–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773
774
775class EnumInt32(enum.IntEnum, metaclass=fbe.DefaultEnumMeta):
776 ENUM_VALUE_0 = int(0) + 0
777 ENUM_VALUE_1 = int(-2147483648) + 0
778 ENUM_VALUE_2 = int(-2147483648) + 1
779 ENUM_VALUE_3 = int(2147483646) + 0
780 ENUM_VALUE_4 = int(2147483646) + 1
781 ENUM_VALUE_5 = ENUM_VALUE_3
782 unknown = ~0
783
784 __slots__ = ()
785
786 def __format__(self, format_spec):
787 return self.__str__()
788
789 def __str__(self):
790 if self.value == EnumInt32.ENUM_VALUE_0:
791 return "ENUM_VALUE_0"
792 if self.value == EnumInt32.ENUM_VALUE_1:
793 return "ENUM_VALUE_1"
794 if self.value == EnumInt32.ENUM_VALUE_2:
795 return "ENUM_VALUE_2"
796 if self.value == EnumInt32.ENUM_VALUE_3:
797 return "ENUM_VALUE_3"
798 if self.value == EnumInt32.ENUM_VALUE_4:
799 return "ENUM_VALUE_4"
800 if self.value == EnumInt32.ENUM_VALUE_5:
801 return "ENUM_VALUE_5"
802 return "<unknown>"
803
804 @classmethod
805 def _missing_(cls, value):
806 return EnumInt32.unknown
807
808 @staticmethod
809 def __from_json__(value):
810 if value is None:
811 return None
812 return EnumInt32(value)
813
814
815# Fast Binary Encoding EnumInt32 field model

Callers 3

__from_json__Method · 0.70
getMethod · 0.70
getMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected