From 5aec688f950a407be8dc381d503e8b09df96621c Mon Sep 17 00:00:00 2001 From: Michael McMaster Date: Thu, 15 Apr 2021 15:59:09 +1000 Subject: [PATCH] missed file --- .../scsi2sd/model/StorageDeviceEnum.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 scsi2sd.ui/src/main/java/com/codesrc/scsi2sd/model/StorageDeviceEnum.java 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 index 0000000..85c64e0 --- /dev/null +++ b/scsi2sd.ui/src/main/java/com/codesrc/scsi2sd/model/StorageDeviceEnum.java @@ -0,0 +1,52 @@ +// Copyright (C) 2019 Michael McMaster +// +// 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 . + +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; + } +} -- 2.38.5