package com.njcn.process.enums;

import lombok.Getter;

@Getter
public enum AlarmTypeEnum {
    EARLY_WARN(0, "电能质量技术预警单"),
    REPORT_WARN(1, "电能质量技术告警单");
    private final Integer code;

    private final String message;

    AlarmTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static AlarmTypeEnum getAlarmTypeEnumByCode(Integer code) {
        for (AlarmTypeEnum alarmTypeEnum : AlarmTypeEnum.values()) {
            if (alarmTypeEnum.getCode().equals(code)) {
                return alarmTypeEnum;
            }
        }
        return null;
    }
}
