]> localhost Git - scsi2sd-util.git/commitdiff
missed file norFlash
authorMichael McMaster <michael@codesrc.com>
Thu, 15 Apr 2021 05:59:09 +0000 (15:59 +1000)
committerMichael McMaster <michael@codesrc.com>
Thu, 15 Apr 2021 05:59:09 +0000 (15:59 +1000)
scsi2sd.ui/src/main/java/com/codesrc/scsi2sd/model/StorageDeviceEnum.java [new file with mode: 0644]

diff --git a/scsi2sd.ui/src/main/java/com/codesrc/scsi2sd/model/StorageDeviceEnum.java b/scsi2sd.ui/src/main/java/com/codesrc/scsi2sd/model/StorageDeviceEnum.java
new file mode 100644 (file)
index 0000000..85c64e0
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright (C) 2019 Michael McMaster <michael@codesrc.com>
+//
+// This file is part of scsi2sd-util.
+//
+// scsi2sd-util is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// scsi2sd-util is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with scsi2sd-util.  If not, see <https://www.gnu.org/licenses/>.
+
+package com.codesrc.scsi2sd.model;
+
+import java.util.EnumSet;
+
+public enum StorageDeviceEnum {
+    S2S_STORAGE_SD(0, "SD"),
+    S2S_STORAGE_FLASH(1, "SPI Flash");
+
+    static StorageDeviceEnum fromValue(byte value) {
+        for (StorageDeviceEnum deviceType : EnumSet.allOf(StorageDeviceEnum.class)) {
+            if (deviceType.value == value)
+            {
+                return deviceType;
+            }
+        }
+        return S2S_STORAGE_SD;
+    }
+
+
+    private int value;
+    private String desc;
+
+    StorageDeviceEnum(int value, String desc) {
+        this.value = value;
+        this.desc = desc;
+    }
+
+    public int getValue() { return this.value; }
+
+    @Override
+    public String toString()
+    {
+        return this.desc;
+    }
+}