Reputation: 448
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);
Upvotes: 0
Views: 1840
Reputation: 1074365
In Java, "dictionaries" are called Map
s. Refer to the various interfaces and implementations in java.util
. The main interface you'd probably want is Map
. 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 a Map
depends entirely on what you have to start with.
Upvotes: 1