码迷,mamicode.com
首页 > 其他好文 > 详细

枚举类应用

时间:2017-04-28 13:34:40      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:bsp   rip   author   str   pack   pre   style   异常   public   

package com.tz.core;
/**
 * 枚举类
 * @author Administrator
 * 使用:ErrorMsgEnum.ERR_1000.getDiscription();
 */
public enum ErrorMsgEnum {
 
    ERR_1000("1000","中间价为空"),
    ERR_1001("1001","获取黄金基准价异常"),
    ERR_1002("1002","获取黄金基准价异常"),
    ERR_1003("1003","获取黄金基准价异常"),
    ERR_1004("1004","获取黄金基准价异常"),
    ERR_1005("1005","获取黄金基准价异常");
    
    private String key;
    private String discription;
    public String getKey() {
        return key;
    }
    
    public String getDiscription() {
        return discription;
    }
    
    private ErrorMsgEnum(){
        
    }
    
    private ErrorMsgEnum(String key,String discription){
        this.key = key;
        this.discription = discription;
    }
}

 

枚举类应用

标签:bsp   rip   author   str   pack   pre   style   异常   public   

原文地址:http://www.cnblogs.com/lhl-shubiao/p/6780831.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!