T
- the capsuled resourcepublic class ApiResult<T> extends Object implements Serializable
result
.Modifier and Type | Class and Description |
---|---|
static class |
ApiResult.DevelopmentView
View class for development purposes.
|
static class |
ApiResult.PublicView
View class for development purposes.
|
static class |
ApiResult.ResultStatus
The result status.
|
Constructor and Description |
---|
ApiResult() |
Modifier and Type | Method and Description |
---|---|
List<ApiResultError> |
getErrors() |
String |
getMessage()
Get a message, mainly used in case of errors
|
Map<String,Object> |
getMetaData()
Get a map of meta data
|
T |
getResult() |
String |
getStatus() |
void |
setErrors(List<ApiResultError> errors) |
void |
setMessage(String message) |
void |
setMetaData(Map<String,Object> metaData)
Set the meta data for the response
|
void |
setResult(T result) |
void |
setStatus(String status)
Sets the status (must be of a value defined in
ApiResult.ResultStatus |
String |
toString() |
void |
writeToOutputStream(OutputStream outputStream)
Writes the object in json format to the given stream.
|
public List<ApiResultError> getErrors()
public String getMessage()
public Map<String,Object> getMetaData()
public T getResult()
public String getStatus()
public void setErrors(List<ApiResultError> errors)
errors
- the errors to setpublic void setMessage(String message)
message
- an messagepublic void setMetaData(Map<String,Object> metaData)
metaData
- map with meta data to extend the resultpublic void setResult(T result)
result
- the result objectpublic void setStatus(String status)
ApiResult.ResultStatus
status
- status to be setpublic void writeToOutputStream(OutputStream outputStream) throws IOException
outputStream
- The stream to write the object to.IOException
- Exception.Copyright © 2019 Communote team. All rights reserved.