Implement writeBack to JsonObject in FlagStorage
Dieser Commit ist enthalten in:
Ursprung
ffd0bd7515
Commit
0040f2c40d
@ -38,7 +38,11 @@ public class FlagStorage {
|
||||
}
|
||||
|
||||
public boolean set(final Flag flagType, final Flag.Value<?> value) {
|
||||
return flags.put(flagType, value) != value;
|
||||
if (flags.put(flagType, value) != value) {
|
||||
writeChangedKey(flagType, value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -52,4 +56,8 @@ public class FlagStorage {
|
||||
flags.put(flag, flagValue == null ? flag.getDefaultValue() : flag.getFlagValueOf(flagValue.getAsString().toUpperCase()));
|
||||
}
|
||||
}
|
||||
|
||||
private void writeChangedKey(Flag flag, Flag.Value<?> value) {
|
||||
jsonObject.add(flag.name().toLowerCase(), new JsonPrimitive(value.getValue().getName()));
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren