Skip to content

EnumPair

Source code in library_analyzer/processing/annotations/model/_annotations.py
@dataclass
class EnumPair:
    stringValue: str
    instanceName: str

    def to_json(self) -> dict:
        return asdict(self)

    @staticmethod
    def from_json(json: Any) -> EnumPair:
        return EnumPair(json["stringValue"], json["instanceName"])

    def __eq__(self, other: Any) -> bool:
        return (
            isinstance(other, EnumPair)
            and self.stringValue == other.stringValue
            and self.instanceName == other.instanceName
        )

instanceName: str class-attribute

stringValue: str class-attribute

__eq__(other)

Source code in library_analyzer/processing/annotations/model/_annotations.py
def __eq__(self, other: Any) -> bool:
    return (
        isinstance(other, EnumPair)
        and self.stringValue == other.stringValue
        and self.instanceName == other.instanceName
    )

from_json(json) staticmethod

Source code in library_analyzer/processing/annotations/model/_annotations.py
@staticmethod
def from_json(json: Any) -> EnumPair:
    return EnumPair(json["stringValue"], json["instanceName"])

to_json()

Source code in library_analyzer/processing/annotations/model/_annotations.py
def to_json(self) -> dict:
    return asdict(self)