Package nl.knaw.dans.lib.dataverse
Class DataverseResponse<D>
java.lang.Object
nl.knaw.dans.lib.dataverse.DataverseResponseWithoutEnvelope<DataverseEnvelope<D>>
nl.knaw.dans.lib.dataverse.DataverseResponse<D>
- Type Parameters:
D
- the type of the data of the response message envelope, one of the classes innl.knaw.dans.lib.dataverse.model
- Direct Known Subclasses:
DataverseHttpResponse
Response from Dataverse, wrapped in a
DataverseEnvelope
.-
Constructor Summary
ModifierConstructorDescriptionprotected
DataverseResponse
(String bodyText, com.fasterxml.jackson.databind.ObjectMapper mapper, Class<?>... dataClass) -
Method Summary
Methods inherited from class nl.knaw.dans.lib.dataverse.DataverseResponseWithoutEnvelope
getBodyAsJson, getBodyAsObject, getBodyAsString
-
Constructor Details
-
DataverseResponse
-
-
Method Details
-
getEnvelope
- Returns:
- A dataverse envelope
- Throws:
com.fasterxml.jackson.core.JsonParseException
- if body cannot be processed properly as JSONIOException
-
getData
- Returns:
- the payload of the envelope directly
- Throws:
com.fasterxml.jackson.core.JsonParseException
- if body cannot be processed properly as JSONIOException
-
getEnvelopeAsJson
- Returns:
- the envelope as a JSON AST
- Throws:
com.fasterxml.jackson.core.JsonParseException
- if body cannot be processed properly as JSONIOException
-
getEnvelopeAsString
- Returns:
- the body as a String
-