package com.gk.hotwork.specialWork.enums; import java.util.HashMap; import java.util.Map; /** * 值匹配模式 */ public enum RuleStandMatchingTypeEnum { GREATER_THAN((byte) 1, "大于"), EQUAL((byte) 2, "等于"), LESS_THAN((byte) 3, "小于"), GREATER_THAN_AND_EQUAL((byte) 4, "大于等于"), LESS_THAN_AND_EQUAL((byte) 5, "小于等于"), ; RuleStandMatchingTypeEnum(byte code, String value) { this.code = code; this.value = value; } byte code; String value; static Map map; static { map = new HashMap<>(); for (RuleStandMatchingTypeEnum e : RuleStandMatchingTypeEnum.values()) { map.put(e.code, e); } } public static RuleStandMatchingTypeEnum parse(Byte code) { return map.get(code); } public byte getCode() { return code; } public String getValue() { return value; } }