iterate through getasjsonobject 28 29 entryset 28 29

Solutions on MaxInterview for iterate through getasjsonobject 28 29 entryset 28 29 by the best coders in the world

showing results for - "iterate through getasjsonobject 28 29 entryset 28 29"
Elif
28 Nov 2017
1JsonObject object;
2ArrayList<Integer> codes = new ArrayList<Integer>();
3for (Map.Entry<String,JsonElement> entry : object.entrySet()) {
4    JsonArray array = entry.getValue().getAsJsonObject().getAsJsonArray("unterfeld");
5    for (JsonElement codeHolder : array) {
6        codes.add(codeHolder.getAsJsonObject().getAsJsonPrimitive("code").getAsInt());
7    }
8}