Allowed GenericTypes in addJsonObject method

This commit is contained in:
Ka0rX 2023-03-19 14:02:50 +01:00
parent 037fb131ec
commit 4244bdbe3c

View File

@ -95,10 +95,10 @@ public class PlayerDataTableUpdater {
addData(key, json.toString());
}
public void addJSONObject(String key, Set<Map.Entry<String, Integer>> collection) {
public <T,V> void addJSONObject(String key, Set<Map.Entry<T, V>> collection) {
JsonObject json = new JsonObject();
for (Map.Entry<String, Integer> entry : collection)
json.addProperty(entry.getKey(), entry.getValue());
for (Map.Entry<T, V> entry : collection)
json.addProperty(entry.getKey().toString(), entry.getValue().toString());
addData(key, json.toString());
}
}