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

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

时间:2019-05-20 01:20:25      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:boolean   tms   set   override   OLE   ret   iss   get   方便   

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类 以后可以方便复制用

标签:boolean   tms   set   override   OLE   ret   iss   get   方便   

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

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