Re: Fw: Generics in enums

2013-05-30 Thread Peter Levart
On 05/30/2013 09:26 AM, Remi Forax wrote: On 05/30/2013 09:06 AM, Victor Polischuk wrote: Good day Joe, Thank you for your prompt reply. If I understood you correctly, it is not the solution which can help me distinguish enum elements by type parameters. I would like to have restrictions on t

Re: Fw: Generics in enums

2013-05-30 Thread Remi Forax
On 05/30/2013 09:06 AM, Victor Polischuk wrote: Good day Joe, Thank you for your prompt reply. If I understood you correctly, it is not the solution which can help me distinguish enum elements by type parameters. I would like to have restrictions on types which can be passed to a enum instance

Re[2]: Fw: Generics in enums

2013-05-30 Thread Victor Polischuk
Good day Joe, Thank you for your prompt reply. If I understood you correctly, it is not the solution which can help me distinguish enum elements by type parameters. I would like to have restrictions on types which can be passed to a enum instance methods and reduce numbers of casts or "instance

Re: Fw: Generics in enums

2013-05-29 Thread Joe Darcy
Hello Victor, On 5/29/2013 11:25 PM, Victor Polischuk wrote: Greetings, I beg pardon for the previous HTML mail. Some time ago I wanted to migrate our "commons-lang" enums to "java 5" enumerations, but I encountered an issue that it cannot be done without discarding generics since java enums

Fw: Generics in enums

2013-05-29 Thread Victor Polischuk
Greetings, I beg pardon for the previous HTML mail. Some time ago I wanted to migrate our "commons-lang" enums to "java 5" enumerations, but I encountered an issue that it cannot be done without discarding generics since java enums do not support them. Let me show an example: //-- public