标签:getc 枚举 ali ipa 支付宝 values ret this cee
public enum PayServiceEnum { ALIPAY("ALIPAY","支付宝"), WECHAT("WECHAT","微信支付"), UNIONPAY("UNIONPAY","银联支付"); private String code; private String desc; public String getCode() { return code; } public String getDesc() { return desc; } PayServiceEnum(String code, String desc) { this.code = code; this.desc = desc; } public static PayServiceEnum getByCode(String code){ for (PayServiceEnum value : PayServiceEnum.values()) { if(value.getCode().equals(code)){ return value; } } return null; } }
标签:getc 枚举 ali ipa 支付宝 values ret this cee
原文地址:https://www.cnblogs.com/leeego-123/p/11381970.html