类 Result<T>
java.lang.Object
cn.bbwres.biscuit.dto.Result<T>
- 所有已实现的接口:
Serializable
通用返回对象
- 版本:
- $Id: $Id
- 作者:
- zhanglinfeng
- 另请参阅:
-
构造器概要
构造器构造器说明Result()Constructor for Result.Constructor for Result.Constructor for Result.Constructor for Result.i18n处理 -
方法概要
修饰符和类型方法说明检查并获取数据boolean检查是否为成功static <T> Result<T> 处理失败static <T> Result<T> 处理失败getData()Getter for the fielddata.Getter for the fieldresultCode.Getter for the fieldresultMsg.voidSetter for the fielddata.voidsetResultCode(String resultCode) Setter for the fieldresultCode.voidsetResultMsg(String resultMsg) Setter for the fieldresultMsg.static <T> Result<T> success(T data) 处理成功
-
构造器详细资料
-
Result
public Result()Constructor for Result.
-
Result
Constructor for Result.
-
Result
Constructor for Result.
-
Result
public Result(org.springframework.context.support.MessageSourceAccessor messages, ErrorCode errorCode) i18n处理- 参数:
messages- messageserrorCode- errorCode
-
Result
Constructor for Result.
- 参数:
resultCode- aStringobject
-
-
方法详细资料
-
success
处理成功- 类型参数:
T- 返回当前数据- 参数:
data- 数据- 返回:
- 返回处理成功的对象
-
error
处理失败- 类型参数:
T- 数据对象- 参数:
errorCode- 错误码errorMsg- 错误描述- 返回:
- 处理失败的数据
-
checkSuccess
public boolean checkSuccess()检查是否为成功- 返回:
- true 成功
-
error
处理失败- 类型参数:
T- 数据对象- 参数:
errorCode- 错误码- 返回:
- 处理失败的数据
-
getResultCode
Getter for the field
resultCode.- 返回:
- a
Stringobject
-
setResultCode
Setter for the field
resultCode.- 参数:
resultCode- aStringobject
-
getResultMsg
Getter for the field
resultMsg.- 返回:
- a
Stringobject
-
setResultMsg
Setter for the field
resultMsg.- 参数:
resultMsg- aStringobject
-
getData
Getter for the field
data.- 返回:
- a T object
-
checkAndGetData
检查并获取数据- 返回:
-
setData
Setter for the field
data.- 参数:
data- a T object
-