klyn.Enum.valueAt
method
public static valueAt(enumType as Type, ordinal as Int) as Enum:
Description

Resolves the canonical singleton at one declaration ordinal.

Parameters
ParameterDescription
enumTypeConcrete enum type.
ordinalZero-based declaration position.
Returns

Canonical state singleton.

Throws
  • ValueException when the type or ordinal is invalid.
Example
enum Color:
RED
BLUE

assert Enum.valueAt(Color.type, 1) is Color.BLUE