The generated code is equivalent to the following:
Each enumerator defines
value properties that supply the enumerator's name and ordinal value, respectively. Enumerators also define
toString methods, and the enumerated type itself defines a
valueOf method that converts ordinal values into their corresponding enumerators.
Suppose we modify the Slice definition to include a custom enumerator value:
The generated code changes accordingly:
Given the above definitions, we can use enumerated values as follows:
Note that the generated type may contain other members, which we have not shown. These members are internal to the Ice run time and you must not use them in your application code (because they may change from release to release).