This content has been marked as final. Show 3 replies
It's defeating the point of using an enum.
It sounds like you just need a collection of regular old objects.
What are the particular advantages of an enum that you were hoping you'd be using in doing this? I can't help wondering if the solution is just to be careful to override equals and hashcode properly.
I need to be able to create a new ENUM on the fly...Yep. Defeats the purpose. On a side note, you can have instance members in enums (methods, variables) if you weren't aware of that yet.
You could make XYZ an interface, and have a pre-defined list of enums that implement that interface, and a class that also implements XYZ so you can add user-defined values.