Package nl.knaw.dans.lib.dataverse
Class DataverseResponseWithoutEnvelope<B>
java.lang.Object
nl.knaw.dans.lib.dataverse.DataverseResponseWithoutEnvelope<B>
- Type Parameters:
B
- the type of the data of the response body
- Direct Known Subclasses:
DataverseHttpResponseWithoutEnvelope
,DataverseResponse
Response from Dataverse that is not wrapped in an envelope. Normally, Dataverse responses are wrapped in an
envelope that contains metadata about the response, such as the status code and the message. In some cases, however,
the response is not wrapped in an envelope. This class is used to handle such responses.
-
Constructor Summary
ModifierConstructorDescriptionprotected
DataverseResponseWithoutEnvelope
(String bodyText, com.fasterxml.jackson.databind.ObjectMapper mapper, Class<?>... dataClass) -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNode
-
Constructor Details
-
DataverseResponseWithoutEnvelope
-
-
Method Details
-
getBodyAsObject
- Returns:
- the body as bean of type D
- Throws:
com.fasterxml.jackson.core.JsonParseException
- if body cannot be processed properly as JSONIOException
-
getBodyAsJson
- Returns:
- the body as a JsonNode
- Throws:
com.fasterxml.jackson.core.JsonParseException
- if body cannot be processed properly as JSONIOException
-
getBodyAsString
- Returns:
- the body as a String
-