Update ConfigKeeper.java
This commit is contained in:
parent
fb1ef6249f
commit
639462d25b
1 changed files with 7 additions and 4 deletions
|
@ -213,12 +213,11 @@ public final class ConfigKeeper {
|
|||
|
||||
public static class EnumEntry<T extends Enum<T>> extends Entry<T> {
|
||||
|
||||
private Type type;
|
||||
private final Type type;
|
||||
|
||||
public EnumEntry(T defaultValue) {
|
||||
super(defaultValue);
|
||||
this.type = new TypeToken<T>(){
|
||||
private static final long serialVersionUID = 1L;}.getType();
|
||||
this.type = new EntryType().getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -234,7 +233,11 @@ public final class ConfigKeeper {
|
|||
@Override
|
||||
public void toJson(JsonObject json, String key, T value) {
|
||||
json.addProperty(key, JsonFactory.GSON.toJson(json, type));
|
||||
}
|
||||
}
|
||||
|
||||
private class EntryType extends TypeToken<T> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class RangeEntry<T extends Comparable<T>> extends Entry<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue