package com.ruoyi.ss.device.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 断电方式
 * @author qzz
 * 2024/3/22
 */
@AllArgsConstructor
@Getter
public enum DeviceOutageWay {

	NOT_OUTAGE("0",  "正"),
	IMMEDIATE("1", "反");

    private final String value;
    private final String msg;

    public static DeviceOutageWay parse(String value) {
        for (DeviceOutageWay obj : DeviceOutageWay.values()) {
            if (Objects.equals(obj.getValue(), value)) {
                return obj;
            }
        }
        throw new RuntimeException("不存在值为" + value + "的断电方式");
    }

}
