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

Class EnumUInt8

projects/Python/proto/enums.py:451–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449
450
451class EnumUInt8(enum.IntEnum, metaclass=fbe.DefaultEnumMeta):
452 ENUM_VALUE_0 = int(0) + 0
453 ENUM_VALUE_1 = int(0) + 0
454 ENUM_VALUE_2 = int(0) + 1
455 ENUM_VALUE_3 = int(254) + 0
456 ENUM_VALUE_4 = int(254) + 1
457 ENUM_VALUE_5 = ENUM_VALUE_3
458 unknown = ~0
459
460 __slots__ = ()
461
462 def __format__(self, format_spec):
463 return self.__str__()
464
465 def __str__(self):
466 if self.value == EnumUInt8.ENUM_VALUE_0:
467 return "ENUM_VALUE_0"
468 if self.value == EnumUInt8.ENUM_VALUE_1:
469 return "ENUM_VALUE_1"
470 if self.value == EnumUInt8.ENUM_VALUE_2:
471 return "ENUM_VALUE_2"
472 if self.value == EnumUInt8.ENUM_VALUE_3:
473 return "ENUM_VALUE_3"
474 if self.value == EnumUInt8.ENUM_VALUE_4:
475 return "ENUM_VALUE_4"
476 if self.value == EnumUInt8.ENUM_VALUE_5:
477 return "ENUM_VALUE_5"
478 return "<unknown>"
479
480 @classmethod
481 def _missing_(cls, value):
482 return EnumUInt8.unknown
483
484 @staticmethod
485 def __from_json__(value):
486 if value is None:
487 return None
488 return EnumUInt8(value)
489
490
491# Fast Binary Encoding EnumUInt8 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