package com.gkhy.safePlatform.account.enums; import java.util.HashMap; import java.util.Map; public enum AppTypeEnum { GT_APP((byte)1,"国泰app"), ; AppTypeEnum(byte code, String value) { this.code = code; this.value = value; } byte code; String value; public byte getCode() { return code; } public String getValue() { return value; } static Map map; static { map = new HashMap<>(); for (AppTypeEnum typeEnum : AppTypeEnum.values()) { map.put(typeEnum.code, typeEnum); } } public static AppTypeEnum parse(Byte code) { return map.get(code); } }