java json/object to array
- by heldopslippers
Hi people. I have a question about type casting. I have the following json String:
{"server":"clients","method":"whoIs","arguments":["hello"]}
I am parsing it to the following Map< String, Object
{arguments=[hello], method=whoIs, server=clients}
It is now possible to do the following:
request.get("arguments");
This works fine. But i need to get the array the is stored in the arguments. How can i accomplish this? I tried (for example) the following:
System.out.println(request.get("arguments")[0]);
But of course this doesn't work..
Does anybody know how this would be possible?