package com.sky.ioc.enums;

public enum NoticeTypeEnums {

    NOTICE_TYPE_INSTATION(1, "系统通知"),
    NOTICE_TYPE_UPDATE(2, "提醒消息"),
    NOTICE_TYPE_ALARM(3, "设备告警");

    private Integer type;

    private String desc;

    private NoticeTypeEnums(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getValue(Integer type) {
        NoticeTypeEnums[] NoticeTypeEnums = values();
        for (NoticeTypeEnums noticeTypeEnums : NoticeTypeEnums) {
            if (noticeTypeEnums.type().equals(type)) {
                return noticeTypeEnums.desc();
            }
        }
        return null;
    }

    public static Integer getType(String desc) {
        NoticeTypeEnums[] NoticeTypeEnumss = values();
        for (NoticeTypeEnums NoticeTypeEnums : NoticeTypeEnumss) {
            if (NoticeTypeEnums.desc().equals(desc)) {
                return NoticeTypeEnums.type();
            }
        }
        return null;
    }

    private Integer type() {
        return this.type;
    }

    private String desc() {
        return this.desc;
    }
}
