public class Result<T> extends Object implements Serializable
| 构造器和说明 |
|---|
Result() |
Result(boolean success,
int code,
String msg,
T result) |
Result(int code,
String msg) |
Result(T result) |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> Result<T> |
failed(int code)
失败
|
static <T> Result<T> |
failed(String msg)
失败
|
int |
getCode() |
String |
getMsg() |
T |
getResult() |
boolean |
isSuccess() |
void |
setCode(int code) |
void |
setMsg(String msg) |
void |
setResult(T result) |
void |
setSuccess(boolean success) |
static <T> Result<T> |
sucess()
成功
|
static <T> Result<T> |
sucess(T t)
成功
|
public Result()
public Result(boolean success,
int code,
String msg,
T result)
success - 成功标记code - 错误码msg - 错误消息result - 返回内容public Result(int code,
String msg)
code - 错误码msg - 错误消息public Result(T result)
result - 处理结果public boolean isSuccess()
public void setSuccess(boolean success)
public String getMsg()
public void setMsg(String msg)
public int getCode()
public void setCode(int code)
public T getResult()
public void setResult(T result)
public static <T> Result<T> sucess(T t)
T - 泛型t - 结果public static <T> Result<T> sucess()
T - 泛型public static <T> Result<T> failed(int code)
T - 泛型code - 错误码Copyright © 2021. All rights reserved.