zoukankan      html  css  js  c++  java
  • 泛型

    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};
        }
    }
    
  • 相关阅读:
    Typora集成免费图床:PicGo + Gitee
    Github shields徽章配置方法介绍
    Python爬虫的简易流程
    MVC学习系列——Filter扩展
    MVC学习系列——ActionResult扩展
    JQuery插件,傻傻分不清!
    闲谈前端编码解码、C#编码解码。
    年终总结和职业规划
    MVC学习系列——记一次失败面试后,感想。
    C/C++四种退出线程的方法
  • 原文地址:https://www.cnblogs.com/caidongzhou/p/9150924.html
Copyright © 2011-2022 走看看