package com.ruoyi.erp.domain; import java.io.IOException; /** * 交易规则 */ public enum TradeRule { YHB_ONLY, YHB_OPTIONAL; public String toValue() { switch (this) { case YHB_ONLY: return "yhbOnly"; case YHB_OPTIONAL: return "yhbOptional"; } return null; } public static TradeRule forValue(String value) throws IOException { if (value.equals("yhbOnly")) return YHB_ONLY; if (value.equals("yhbOptional")) return YHB_OPTIONAL; throw new IOException("Cannot deserialize TradeRule"); } }