MCPcopy Create free account
hub / github.com/apache/fory / Enum

Class Enum

compiler/fory_compiler/ir/ast.py:235–252  ·  view source on GitHub ↗

An enum definition.

Source from the content-addressed store, hash-verified

233
234@dataclass
235class Enum:
236 """An enum definition."""
237
238 name: str
239 type_id: Optional[int]
240 values: List[EnumValue] = field(default_factory=list)
241 options: dict = field(default_factory=dict)
242 line: int = 0
243 column: int = 0
244 location: Optional[SourceLocation] = None
245 id_generated: bool = False
246 id_source: Optional[str] = None
247 source_package: Optional[str] = None
248
249 def __repr__(self) -> str:
250 id_str = f" [id={self.type_id}]" if self.type_id is not None else ""
251 opts_str = f", options={len(self.options)}" if self.options else ""
252 return f"Enum({self.name}{id_str}, values={self.values}{opts_str})"
253
254
255@dataclass

Callers 3

_translate_enumMethod · 0.90
parse_enumMethod · 0.90
_translate_enumMethod · 0.90

Calls 1

fieldFunction · 0.50

Tested by

no test coverage detected