A DESCRIPTION OF THE REQUEST :
When java code needs to interact with legacy systems, other languages etc. The Enum's ordinal value is an obvious choice for transfering between java and the other system. It would be useful if a static method
MyEnum e = MyEnum.fromOrdinal(int ordinal)
was generated in my enum class so that i could get the correct enum from the ordinal value.
JUSTIFICATION :
This logic must be hand done by checking each enums ordinal value to the other system/languages value. If the number of enums changes in the future, this checking code must be adjusted making it brittle.
CUSTOMER SUBMITTED WORKAROUND :
You must loop over all ordinal values comparing as you go. If later on another enum value is added, this loop may need to be adjusted to accomodate this extra item. Using Enum.fromOrdinal would eliminate this programming error.