Forums Register Login

Using generics with enums

+Pie Number of slices to send: Send
Hi All,

I have a use case of an enum A, that has 4 values & these 4 values maps to 4 different emums , so that i can access the values of those enums

E.g:

I can do A.Value_1.getMappedEnum().Value_1.1

or A.Value_2.getMappedEnum().Value_2.2

I feel this can be achieved by using generics + enums. I have not succeeded in doing so.
My source of truth is http://madbean.com/2004/mb2004-3/ & http://www.angelikalanger.com/GenericsFAQ/FAQSections/TypeParameters.html#FAQ106.


Could anyone please help me in achieving this.


Regards,
Sumit
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 968 times.
Similar Threads
generics
Generics
Generics
Generics
generics
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:26:50.