package cn.net.test;

public enum ThreadErrorConstant {
	code_10001(10001,"sql提交错误"),
	code_65500(0xFFDC,"客户端上行的协议与工作模式不匹配");
	
	public   static ThreadErrorConstant getErrorEnum(int  error_code) {
        for  (ThreadErrorConstant errorEnum : ThreadErrorConstant.values()) {
            if  (errorEnum.error_code == error_code) {  
                return  errorEnum;  
            }  
        }  
        return  null ;  
    } 
	
	private int error_code;
	private String error_msg;
	private ThreadErrorConstant(int error_code,String error_msg) {
		this.error_code = error_code;
		this.error_msg = error_msg;
	}
	
	public int getError_code() {
		return error_code;
	}
	public void setError_code(int error_code) {
		this.error_code = error_code;
	}
	public String getError_msg() {
		return error_msg;
	}
	public void setError_msg(String error_msg) {
		this.error_msg = error_msg;
	}
}
