T - the type parameterpublic class JSONAPIDocument<T> extends Object
| Constructor and Description |
|---|
JSONAPIDocument()
Creates new JSONAPIDocument.
|
JSONAPIDocument(T data)
Creates new JsonApiDocument.
|
JSONAPIDocument(T data,
com.fasterxml.jackson.databind.ObjectMapper deserializer)
Creates new JSONAPIDocument.
|
| Modifier and Type | Method and Description |
|---|---|
static JSONAPIDocument<?> |
createErrorDocument(Iterable<? extends Error> errors)
Factory method for creating JSONAPIDocument that holds the Error object.
|
T |
get()
Gets resource object
|
Iterable<? extends Error> |
getErrors()
Returns error objects or
null in case no errors were set. |
Links |
getLinks()
Gets links.
|
Map<String,?> |
getMeta()
Get meta data.
|
<T> T |
getMeta(Class<?> metaType)
Returns typed meta-data object or
null if no meta is present. |
void |
setLinks(Links links)
Sets links.
|
void |
setMeta(Map<String,?> meta)
Sets meta data.
|
public JSONAPIDocument(T data)
data - T API resource typepublic JSONAPIDocument(T data, com.fasterxml.jackson.databind.ObjectMapper deserializer)
data - T API resource typedeserializer - ObjectMapper deserializer to be used for handling meta conversionpublic JSONAPIDocument()
public static JSONAPIDocument<?> createErrorDocument(Iterable<? extends Error> errors)
This method should be used in case error response is being built by the server side.
errors - public T get()
T resource objectpublic Links getLinks()
public void setLinks(Links links)
links - the linkspublic <T> T getMeta(Class<?> metaType)
null if no meta is present.T - typemetaType - Class target typenullCopyright © 2017. All rights reserved.