--- /dev/null
+// 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;
+ }
+}