package com.gkhy.safePlatform.riskCtrl.enums; import java.util.HashMap; import java.util.Map; public enum ReportBizEnum { PREVENT_RISK((byte) 1, "双重预防隐患条件报表"), EMERGENCY_PRACTICE((byte)2,"应急管理应急演练报表"), INCIDENT_COUNT((byte) 3, "事故统计报表") ; public byte getType() { return type; } public void setType(byte type) { this.type = type; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } ReportBizEnum(byte type, String desc) { this.type = type; this.desc = desc; } byte type; String desc; static Map map; static { map = new HashMap<>(); for (ReportBizEnum reportBizEnum : ReportBizEnum.values()) { map.put(reportBizEnum.getType(), reportBizEnum); } } public static ReportBizEnum parse(Byte type) { return map.get(type); } }