package com.gkhy.labRiskManage.domain.account.enums; import java.util.HashMap; import java.util.Map; public enum UserIdTypeEnum { TYPE_JUMIN_SHENFENZHENG((byte)1,"居民身份证"), ; private Byte type; private String dec; UserIdTypeEnum(Byte type, String dec) { this.type = type; this.dec = dec; } public Byte getType() { return type; } public void setType(Byte type) { this.type = type; } public static Map getMap() { return map; } public static void setMap(Map map) { UserIdTypeEnum.map = map; } public String getDec() { return dec; } public void setDec(String dec) { this.dec = dec; } static Map map; static { map = new HashMap<>(); for(UserIdTypeEnum e : UserIdTypeEnum.values()){ map.put(e.type,e); } } public static UserIdTypeEnum prase(Byte type){ return map.get(type); } }