Enum追加

This commit is contained in:
r-ca 2024-01-21 19:09:37 +09:00
parent ec7adbe331
commit 19ff824591
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -0,0 +1,30 @@
package one.nem.lacerta.model.pref;
public enum FeatureSwitchOverride {
ENABLE_DEBUG_MENU("enableDebugMenu"),
ENABLE_SEARCH("enableSearch"),
SHOW_DISPLAY_MENU("showDisplayMenu"),
SHOW_DATA_MENU("showDataMenu"),
SHOW_SCAN_MENU("showScanMenu");
private final String key;
FeatureSwitchOverride(String key) {
this.key = key;
}
public String getKey() {
return key;
}
public static FeatureSwitchOverride fromKey(String key) {
for (FeatureSwitchOverride value : values()) {
if (value.getKey().equals(key)) {
return value;
}
}
return null;
}
}