Skip to content

Commit

Permalink
Update src/main/java/com/github/manolo8/darkbot/backpage/hangar/ItemI…
Browse files Browse the repository at this point in the history
…nfo.java


Code refactoring

Co-authored-by: Pablo Herrera <[email protected]>
  • Loading branch information
m9w and Pablete1234 authored Feb 21, 2024
1 parent e1fe915 commit ac911d3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ public List<Map<String, Object>> deserialize(JsonElement json, Type typeOfT, Jso
if (json.isJsonArray()) return context.deserialize(json, typeOfT);
if (json.isJsonObject()) {
final JsonObject obj = json.getAsJsonObject();
return obj.keySet().stream().map(key -> {
Map<String, Object> map = context.deserialize(obj.get(key), Map.class);
map.put("level", key);
return map;
return obj.entrySet().stream().map(entry -> {
Map<String, Object> map = context.deserialize(entry.getValue(), Map.class);
map.put("level", entry.getKey());
return map;
}).collect(Collectors.toList());
}
return null;
Expand Down

0 comments on commit ac911d3

Please sign in to comment.