package com.yeejoin.equipmanage.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author keyong
 * @title: AlarmTypeEnum
 * <pre>
 * @description: TODO
 * </pre>
 * @date 2020/12/22 15:48
 */
@Getter
@AllArgsConstructor
public enum AlarmTypeEnum {

    HZGJ("FIREALARM", "火灾告警"),
    GZGJ("BREAKDOWN", "故障告警"),
    PB("SHIELD", "屏蔽");

    private String code;
    private String type;

    public String getCode() {
        return code;
    }
    public String getType() {
        return type;
    }

    public static String getTypeByCode(String code){
        for (AlarmTypeEnum constants : values()) {
            if (constants.getCode().equals(code)) {
                return constants.getType();
            }
        }
        return null;
    }
}
