mardi 14 janvier 2020

Convert int into enum without beeing able to typecast

Is there a way to convert an integer into an enum without giving the type? Like:

Convert given int into the enum value that the enum is storing as representing value for the given int.

I know the exact enum type but cannot reference it in my scope since the access is not possible due to the degree of protection. Changing the degree of protection is not an option either.

I know I should never do this but sadly there is literally no other way in this case.





Aucun commentaire:

Enregistrer un commentaire