首页 > 其他 > 详细

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

时间:2019-05-19 23:59:55      阅读:188      评论:0      收藏:0      [点我收藏+]
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类 以后可以方便复制用

原文:https://www.cnblogs.com/ZenoLiang/p/10891567.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!