I have a JsonObject e.g
JsonObject jsonObject = {\"keyInt\":2,\"keyString\":\"val1\",\"id\":\"0123456\"}
Every JsonObject contains
JsonObject
Just make following changes...
Map attributes = new HashMap(); Set> entrySet = jsonObject.entrySet(); for(Map.Entry entry : entrySet){ attributes.put(entry.getKey(), jsonObject.get(entry.getKey()).getAsString()); }
"getAsString" will do the magic for u