Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Coping with differing Json object names

 
M Bryan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

from a website I am getting a request in json format. It roughly looks like this:



Usually, I would write something like jsonObject.getAsJsonObject("343153"), but this does not work in this case, since the IDs differ.
How can I extract that two entries into something like a list?

Thank you
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might help to mention which JSON library you are using.
 
M Bryan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google gson
 
M Bryan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay I found it out: jo.entrySet();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic