欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-06-16 10:17:19
public class Result { private boolean success; private int status; private T data; private String msg; public Result() { } public Result(boolean su ......

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 + '\'' +
'}';
}
}