The canonical class name of the enum being emulated
This function is the dynamic function allowing the caller to get an enum constant.
This function is the dynamic function allowing the caller to get an enum constant. Unlike with an actual enum, trying to access a non-existent enum constant cannot throw create a compile-time error. It will however generate the same IllegalArgumentException that valueOf does when the enum constant cannot be found.
NOTE: This function, while exposed publicly, is not intended to be called directly.
val MyEnum = Enum("test.MyEnum", "V1" -> 1, "V2" -> 2) val enumConstant = MyEnum.V1 // GOOD! val sameConstant = MyEnum.selectDynamic("V1") // BAD! Instead use MyEnum.valueOf("V1")
the enum constant.
Eumlates the static valueOf(..) function of a java enum.
Eumlates the static valueOf(..) function of a java enum. Get the enum constant for the provided enum constant name.
the name of an enum constant to retrieve
an enum constant value.
Emulates the static values() function of a java enum.
Emulates the static values() function of a java enum.
an array of enum constants.
This class is designed to emulate Java enum values created by Google's Protocol Buffer library.
The canonical class name of the enum being emulated
the enum constant names and their number (returned by get number).