Package cn.longky.common.model
Class Result<T>
java.lang.Object
cn.longky.common.model.Result<T>
请求结果
- Since:
- 1.0
- Author:
- yingzhan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Result<T>构造请求结果static <T> Result<T>构造请求结果static <T> Result<T>ofSuccess(T result) 构造请求结果static <T> Result<T>构造请求结果构造请求错误结果构造请求结果withSuccess(T result) 构造请求结果withThrowable(Throwable throwable) 构造请求异常结果
-
Constructor Details
-
Result
protected Result() -
Result
protected Result(boolean success)
-
-
Method Details
-
withError
构造请求错误结果- Parameters:
errorCode- 错误码- Returns:
- 请求结果
-
withThrowable
构造请求异常结果- Parameters:
throwable- 异常信息- Returns:
- 请求结果
-
withError
构造请求结果- Parameters:
errorCode- 错误码errorMsg- 错误信息- Returns:
- 请求结果
-
withSuccess
构造请求结果- Parameters:
result- 结果数据- Returns:
- 请求结果
-
ofSuccess
构造请求结果- Type Parameters:
T- 数据类型- Parameters:
result- 结果数据- Returns:
- 请求结果
-
ofError
构造请求结果- Type Parameters:
T- 数据类型- Parameters:
errorCode- 错误码对象- Returns:
- 请求结果
-
ofError
构造请求结果- Type Parameters:
T- 数据类型- Parameters:
errorCode- 错误码errorMsg- 错误信息- Returns:
- 请求结果
-
ofThrowable
构造请求结果- Type Parameters:
T- 数据类型- Parameters:
t- 异常信息- Returns:
- 请求结果
-