[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: enums, generics and other animals

alesj do-not-reply at jboss.com
Fri Mar 7 09:03:59 EST 2008


Another refactoring question. :-)
Since for xml handling I still need to get the right enum by matching the underlying strings.
The thing is that on enums there is already a valueOf method which does similar thing, matching enum's name with input string parameter.
But in our case the names do not match exactly the underlying strings, resulting in needing something like getInstance method which iterates over the enums and does a string match.
Should I just use the valueOf and fix the strings in our tests?
Probably not, since it will break quite some things. :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134852#4134852

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134852



More information about the jboss-dev-forums mailing list