In the solution below, we convert the JSON you've provided in your link as a JSONOject. Then we get the list of names contained in the JSON ("Abaddon", "Archeri", ...). Once we have the list we iterate through it. For each name we get the JSON object associated with it.
Then we use GSON to convert each object into a Demon object. The Demon class has been generated using http://www.jsonschema2pojo.org/ as suggested above.
As all the objects in the JSON have the same structure we need only one class to deserialize every single one of them.
Deserializer
public List<Demon> deserialize(String json) {
try {
JSONObject jsonObject = new JSONObject(json);
final JSONArray names = jsonObject.names();
final List<Demon> demons = new ArrayList<>();
final Gson gson = new Gson();
Demon demon;
for (int i = 0; i < names.length(); i++) {
demon = gson.fromJson(jsonObject.get(names.getString(i)).toString(), Demon.class);
demons.add(demon);
}
return demons;
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
Demon class
public class Demon {
@SerializedName("ailments")
@Expose
public String ailments;
@SerializedName("align")
@Expose
public String align;
@SerializedName("code")
@Expose
public Integer code;
@SerializedName("inherits")
@Expose
public String inherits;
@SerializedName("lvl")
@Expose
public Integer lvl;
@SerializedName("pcoeff")
@Expose
public Integer pcoeff;
@SerializedName("race")
@Expose
public String race;
@SerializedName("resists")
@Expose
public String resists;
@SerializedName("skills")
@Expose
public List<String> skills = null;
@SerializedName("source")
@Expose
public List<String> source = null;
@SerializedName("stats")
@Expose
public List<Integer> stats = null;
public Demon(){
// Default constructor
}
}