This content has been marked as final. Show 3 replies
Assuming you can't redefine the map, then your only option is casting which means the compiler won't be able to guarantee type safety.
See this article for an explanation: [http://www.codeaholics.org/blog/generics-and-mystical-wildcard]
That was a good read. Now I understand why I can't do it, but still can't figure out how to force it.
I found a way to get the data into the options (it's for JBOSS security) - I can define it as a module-option in the XML.
Can't you do something like this? Then you can put whatever you want in there. A string, string, arraylist, etc.
When retreiving the value you can test to see what the object is an instance of using instanceof String or instanceOf String, etc and then process accordingly.