public class GenericResult<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected T |
attachment
Any further information.
|
protected String |
errorMessage
Detail of the error if there is any.
出错消息(仅针对操作不成功的情况) |
protected boolean |
successful
Whether the request was processed successfully.
是否成功处理了请求。 |
Constructor and Description |
---|
GenericResult() |
GenericResult(boolean successful) |
GenericResult(boolean successful,
String errorMsg)
Constructor without the need of attachment parameter.
|
GenericResult(boolean successful,
String errorMsg,
T att)
Constructor.
创建一个对象实例。 |
Modifier and Type | Method and Description |
---|---|
T |
getAttachment() |
String |
getErrorMessage() |
boolean |
isSuccessful() |
void |
setAttachment(T attachment) |
void |
setErrorMessage(String errorMessage) |
void |
setSuccessful(boolean successful) |
String |
toString() |
protected boolean successful
protected String errorMessage
protected T attachment
public GenericResult(boolean successful, String errorMsg, T att)
successful
- Successful or noterrorMsg
- Error messageatt
- Attachementpublic GenericResult(boolean successful, String errorMsg)
successful
- Successful or noterrorMsg
- Error messagepublic GenericResult(boolean successful)
public GenericResult()
public boolean isSuccessful()
public void setSuccessful(boolean successful)
public String getErrorMessage()
public void setErrorMessage(String errorMessage)
public T getAttachment()
public void setAttachment(T attachment)
Copyright © 2014. All Rights Reserved.