Class DataverseResponse<D>

Type Parameters:
D - the type of the data of the response message envelope, one of the classes in nl.knaw.dans.lib.dataverse.model
Direct Known Subclasses:
DataverseHttpResponse

public class DataverseResponse<D> extends DataverseResponseWithoutEnvelope<DataverseEnvelope<D>>
Response from Dataverse, wrapped in a DataverseEnvelope.
  • Constructor Details

    • DataverseResponse

      protected DataverseResponse(String bodyText, com.fasterxml.jackson.databind.ObjectMapper mapper, Class<?>... dataClass)
  • Method Details

    • getEnvelope

      public DataverseEnvelope<D> getEnvelope() throws IOException
      Returns:
      A dataverse envelope
      Throws:
      com.fasterxml.jackson.core.JsonParseException - if body cannot be processed properly as JSON
      IOException
    • getData

      public D getData() throws IOException
      Returns:
      the payload of the envelope directly
      Throws:
      com.fasterxml.jackson.core.JsonParseException - if body cannot be processed properly as JSON
      IOException
    • getEnvelopeAsJson

      public com.fasterxml.jackson.databind.JsonNode getEnvelopeAsJson() throws IOException
      Returns:
      the envelope as a JSON AST
      Throws:
      com.fasterxml.jackson.core.JsonParseException - if body cannot be processed properly as JSON
      IOException
    • getEnvelopeAsString

      public String getEnvelopeAsString()
      Returns:
      the body as a String