public class Result<T> extends Object implements Serializable
| Constructor and Description |
|---|
Result()
构造函数。
|
Result(boolean success,
ErrorContext errorContext,
T resultObj)
构造函数。
|
| Modifier and Type | Method and Description |
|---|---|
ErrorContext |
getErrorContext()
Getter method for property errorContext.
|
T |
getResultObj()
Getter method for property resultObj.
|
boolean |
isSuccess()
Getter method for property success.
|
void |
setErrorContext(ErrorContext errorContext)
Setter method for property errorContext.
|
void |
setResultObj(T resultObj)
Setter method for property resultObj.
|
void |
setSuccess(boolean success)
Setter method for property success.
|
String |
toString()
必须是ToStringStyle.SHORT_PREFIX_STYLE,形式如下:
Person[name=John Doe,age=33,smoker=false]
|
public Result()
public Result(boolean success,
ErrorContext errorContext,
T resultObj)
success - 是否成功。errorContext - 错误上下文。resultObj - 对象实例。public boolean isSuccess()
public void setSuccess(boolean success)
success - value to be assigned to property successpublic ErrorContext getErrorContext()
public void setErrorContext(ErrorContext errorContext)
errorContext - value to be assigned to property errorContextpublic T getResultObj()
public void setResultObj(T resultObj)
resultObj - value to be assigned to property resultObjpublic String toString()
toString in class ObjectObject.toString()Copyright © 2006–2018 TinyGroup. All rights reserved.