枚举类常量的定义类_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > 枚举类常量的定义类

枚举类常量的定义类

 2016/5/12 5:33:32  Fan12345  程序员俱乐部  我要评论(0)
  • 摘要:publicinterfaceCommonEnumTest{publicstaticfinalStringQUERYBYORDERID="queryByOrderId";publicstaticfinalStringQUERYBYCUSTID="queryByCustId";publicstaticfinalStringCREATEORDER="createOrder";publicstaticfinalStringQUERYRECHARGELOG="queryRechargeLog"
  • 标签:枚举
public interface CommonEnumTest {

    public static final String QUERYBYORDERID = "queryByOrderId";
    public static final String QUERYBYCUSTID = "queryByCustId";
    public static final String CREATEORDER = "createOrder";
    public static final String QUERYRECHARGELOG = "queryRechargeLog";
    public static final String QUERYRECHARGELIMIT = "queryRechargeLimit";
    public static final String CREATEPREORDER = "createPreOrder";
    public static final String ORDERPAY = "orderPay";
    public static final String SENDMESSAGE2EL = "sendMessage2EL";
    public static final String CHECKNEWINVUSR = "checkNewInvUsr";
    public static final String MERID ="site";
    public static final String MERID_M = "mobile";
    public static final String VERSION = "10";
    public static final String MERPRIV = "";
    public static final String REQEXT = "";
    public static final String MERKEY = "TS2015";
    public static final String ACCOUNTBASEDA = "BASEDA";//基本借记户
public static final String ACCOUNTSPEDA = "SPEDA";//专用账户
public static final String ACCOUNTPRODDA = "PRODDA";//产品账户
public static final String ACCOUNTPA = "PA"; //积分账户
public static enum OrderPayResultType{
        UNPAY("01", "未支付")
        , CANCEL("02", "订单取消")
        , WAIT_BALANCE_PAY("03", "等待支付尾款")
        , PAY_SUCCESS("04", "支付成功")
        , PAY_FAIL("05", "支付失败")
        , REFUND_UNAUDIT("06", "退款待审核")
        , REFUND_PROCESS("07", "退款处理中")
        , REFUND_SUCCESS("08", "退款成功")
        , REFUND_FAIL("09", "退款失败")
        , REFUND_REJECT("10", "退款拒绝")
        , ORDER_CLOSE("11", "订单关闭")
        , PAY_PROCESS("12", "支付处理中");

        private final String code;
        private final String desc;

        public String getCode() {
            return code;
        }
        public String getDesc() {
            return desc;
        }
        private OrderPayResultType(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }
        public static String getDescByCode(String selectCode) {
            for(int i = 0; i < OrderPayResultType.values().length; i++){
                if(OrderPayResultType.values()[i].code.equals(selectCode)){
                    return OrderPayResultType.values()[i].getDesc();
                }
            }
            return "";
        }
    }

    public static enum BankImage{
        BankImage1("ABC","ABC.png"),
        BankImage2("AHRCU","AHRCU.png"),
        BankImage3("bank_11","bank_11.png"),
        BankImage4("bank_way","bank_way.png"),
        BankImage5("BCCB","BCCB.png"),
        BankImage6("BOCOM","BOCOM.png");

        private final String code;
        private final String desc;

        public String getCode() {
            return code;
        }
        public String getDesc() {
            return desc;
        }
        private BankImage(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }
        public static String getDescByCode(String selectCode) {
            for(int i = 0; i < BankImage.values().length; i++){
                if(BankImage.values()[i].code.equals(selectCode)){
                    return BankImage.values()[i].getDesc();
                }
            }
            return "";
        }
    }

    public static enum BailFlag{
        BAILFLAG_YES("1","支持 "),
        BAILFLAG_NO("2","不支持");

        private final String code;
        private final String desc;

        public String getCode() {
            return code;
        }
        public String getDesc() {
            return desc;
        }
        private BailFlag(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static String getDescByCode(String selectCode) {
            for(int i = 0; i < BailFlag.values().length; i++){
                if(BailFlag.values()[i].code .equals(selectCode)){
                    return BailFlag.values()[i].getDesc();
                }
            }
            return "";
        }
    }

    public static enum BailCalType{
        BAILCALTYPE_RATE("1","按比例 "),
        BAILCALTYPE_AMOUNT("2","定额");

        private final String code;
        private final String desc;

        public String getCode() {
            return code;
        }
        public String getDesc() {
            return desc;
        }
        private BailCalType(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static String getDescByCode(String selectCode) {
            for(int i = 0; i < BailCalType.values().length; i++){
                if(BailCalType.values()[i].code .equals(selectCode)){
                    return BailCalType.values()[i].getDesc();
                }
            }
            return "";
        }
    }
}

?

发表评论
用户名: 匿名