Enum
classin packageklyn
public class Enum extends Object:
└ Enum

Base class for language enumerations.

Enum values are singleton instances stored as static readonly fields on the generated enum class. The compiler injects calls to Enum.bind(...) to associate the symbolic state name used by toString().

Properties
Modifier and Type Member Description
public readonly property declaringType
declaringType as Type:
Concrete enum type declaring this state.
public readonly property name
name as String:
Symbolic state name without the declaring type prefix.
public readonly property ordinal
ordinal as Int:
Zero-based declaration position of this enum state.
Inherited Properties
propertyInherited Properties from Object: type
Methods
Modifier and Type Member Description
public static bind
bind( instance as Enum, stateName as String, typeName as String = "", ordinal as Int = -1 ) as Enum:
Binds an enum instance to its symbolic state name and returns the same instance.
public override toString
toString() as String:
Returns the canonical enum state name in the form TypeName.STATE.
public static valueAt
valueAt(enumType as Type, ordinal as Int) as Enum:
Resolves the canonical singleton at one declaration ordinal.
public static valueOf
valueOf(enumType as Type, stateName as String) as Enum:
Resolves the canonical singleton for a symbolic enum state.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toString, toXml