klyn.Enum.valueOf
method
public static valueOf(enumType as Type, stateName as String) as Enum:
Description

Resolves the canonical singleton for a symbolic enum state.

Parameters
ParameterDescription
enumTypeConcrete enum type.
stateNameExact state name.
Returns

Canonical state singleton.

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

assert Enum.valueOf(Color.type, "RED") is Color.RED