Optimize FlagStorage
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
f0565bb7b9
Commit
998d43d6e3
@ -54,10 +54,18 @@ public class FlagStorage {
|
|||||||
public static YAPIONObject toYAPION(FlagStorage flagStorage) {
|
public static YAPIONObject toYAPION(FlagStorage flagStorage) {
|
||||||
YAPIONObject yapionObject = new YAPIONObject();
|
YAPIONObject yapionObject = new YAPIONObject();
|
||||||
for (final Flag flag : Flag.getFlags()) {
|
for (final Flag flag : Flag.getFlags()) {
|
||||||
yapionObject.add(flag.name(), flagStorage.get(flag).getValue().name());
|
if (flag.getDefaultValue() == flagStorage.flags.getOrDefault(flag, flag.getDefaultValue())) {
|
||||||
|
yapionObject.remove(flag.name());
|
||||||
|
} else {
|
||||||
|
yapionObject.add(flag.name(), flagStorage.get(flag).getValue().name());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (Tag tag : flagStorage.tagSet) {
|
for (Tag tag : Tag.values()) {
|
||||||
yapionObject.add(tag.name(), "");
|
if (flagStorage.tagSet.contains(tag)) {
|
||||||
|
yapionObject.add(tag.name(), "");
|
||||||
|
} else {
|
||||||
|
yapionObject.remove(tag.name());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return yapionObject;
|
return yapionObject;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren