conversion of an XMLRPC object to dictionary in Java
I have an object obj={6=Coffee, 2=[Cocoa,icecream], 1=Chocolate} and I want to convert this to a dictionary so that I can have key as 6, 2, 1 and values ‘Coffee’, ‘Cocoa’ and ‘Chocolate’. How can I do this ? any pointers would be appreciated.
Object obj was returned by method of XMLRPC execute(“execute”, params);
In Java, “dictionaries” are called
Maps. Refer to the various interfaces and implementations injava.util. The main interface you’d probably want isMap. Which implementation you want (HashMap, et. al.) will depend on how you’re using it. How you convert whatever it is you’re starting with into aMapdepends entirely on what you have to start with.