• 泛型


    package com.mmall.common;
    
    public enum ResponseCode {
    
        SUCCESS(0,"SUCESSS"),
        ERROR(1,"ERROR"),
        NEED_LOGIN(10,"NEWWD_LOGIN"),
        ILLEGAL_ARGUMENT(2,"ILLEGAL_AGRUMENT");
    
        private final int code;
        private final String desc;
    
    
        ResponseCode(int code,String desc){
    
            this.code = code;
            this.desc = desc;
        }
    
        public int getCode(){
    
            return code;
        }
    
        public String getDesc(){
    
            return desc;
        }
    
    
    
    }
    
    

    反编译命令是java -jar cfr_0_125.jar --sugarenums false ResponseCode.class
    --sugarenums false参数作用是去除语法糖

    /*
     * Decompiled with CFR 0_125.
     *
     * Could not load the following classes:
     *  java.lang.Enum
     *  java.lang.Object
     *  java.lang.String
     */
    package com.mmall.common;
    
    public final class ResponseCode
    extends Enum<ResponseCode> {
        public static final /* enum */ ResponseCode SUCCESS = new ResponseCode(0, "SUCESSS");
        public static final /* enum */ ResponseCode ERROR = new ResponseCode(1, "ERROR");
        public static final /* enum */ ResponseCode NEED_LOGIN = new ResponseCode(10, "NEWWD_LOGIN");
        public static final /* enum */ ResponseCode ILLEGAL_ARGUMENT = new ResponseCode(2, "ILLEGAL_AGRUMENT");
        private final int code;
        private final String desc;
        private static final /* synthetic */ ResponseCode[] $VALUES;
    
        public static ResponseCode[] values() {
            return (ResponseCode[])$VALUES.clone();
        }
    
        public static ResponseCode valueOf(String string) {
            return (ResponseCode)Enum.valueOf(ResponseCode.class, (String)string);
        }
    
        private ResponseCode(int n2, String string2) {
            super(string, n);
            this.code = n2;
            this.desc = string2;
        }
    
        public int getCode() {
            return this.code;
        }
    
        public String getDesc() {
            return this.desc;
        }
    
        static {
            $VALUES = new ResponseCode[]{SUCCESS, ERROR, NEED_LOGIN, ILLEGAL_ARGUMENT};
        }
    }
    
  • 相关阅读:
    柱状图
    开源版本Visifire的应用
    Jmeter录制脚本-BadBoy
    Jemter环境搭建
    DOS命令
    OSI七层模型
    Google浏览器PostMan插件版安装步骤
    理解JavaScript的caller,callee,call,apply
    .net http请求
    使用命令对象代替switch语句的写法示例
  • 原文地址:https://www.cnblogs.com/caidongzhou/p/9150924.html
Copyright © 2020-2023  润新知