From 19ff8245914947c8fe2dc3103d15e82033c738d0 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 21 Jan 2024 19:09:37 +0900 Subject: [PATCH] =?UTF-8?q?Enum=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/pref/FeatureSwitchOverride.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 model/src/main/java/one/nem/lacerta/model/pref/FeatureSwitchOverride.java diff --git a/model/src/main/java/one/nem/lacerta/model/pref/FeatureSwitchOverride.java b/model/src/main/java/one/nem/lacerta/model/pref/FeatureSwitchOverride.java new file mode 100644 index 00000000..9a9a2497 --- /dev/null +++ b/model/src/main/java/one/nem/lacerta/model/pref/FeatureSwitchOverride.java @@ -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; + } + +}