All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yuweix.kuafu.core.Response Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.yuweix.kuafu.core;


import com.yuweix.kuafu.core.json.JsonUtil;
import java.io.Serializable;


/**
 * @author yuwei
 */
public class Response implements Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private C code;
	private String msg;
	private D data;

	public Response() {

	}
	public Response(C code, String msg) {
		this(code, msg, null);
	}
	public Response(C code, String msg, D data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}
	public static Response of(CC code, String msg) {
		return of(code, msg, null);
	}
	public static Response of(CC code, String msg, DD data) {
		return new Response<>(code, msg, data);
	}

	@Override
	public String toString() {
		return JsonUtil.toJSONString(this);
	}


	public C getCode() {
		return code;
	}
	public void setCode(C code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public D getData() {
		return data;
	}
	public void setData(D data) {
		this.data = data;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy