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

记录一个Result dto类 以后可以方便复制用

时间:2019-01-29 18:14:26      阅读:536      评论:0      收藏:0      [点我收藏+]

标签:ide   return   tostring   font   result   ESS   记录   ret   over   


public class Result<T> {
private boolean success;

private int status;

private T data;

private String msg;

public Result() {
}

public Result(boolean success, int status, T data, String msg) {
this.success = success;
this.status = status;
this.data = data;
this.msg = msg;
}

public Result(boolean success, int status, String msg) {
this.success = success;
this.status = status;
this.msg = msg;
}

public Result(boolean success, String msg) {
this.success = success;
this.msg = msg;
}

public boolean isSuccess() {
return success;
}

public void setSuccess(boolean success) {
this.success = success;
}

public int getStatus() {
return status;
}

public void setStatus(int status) {
this.status = status;
}

public T getData() {
return data;
}

public void setData(T data) {
this.data = data;
}

public String getMsg() {
return msg;
}

public void setMsg(String msg) {
this.msg = msg;
}

@Override
public String toString() {
return "Result{" +
"success=" + success +
", status=" + status +
", data=" + data +
", msg=‘" + msg + \‘‘ +
‘}‘;
}
}

记录一个Result dto类 以后可以方便复制用

标签:ide   return   tostring   font   result   ESS   记录   ret   over   

原文地址:https://www.cnblogs.com/jvhuaxia/p/10333998.html

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