public class Response extends Object
Modifier and Type | Field and Description |
---|---|
Map<String,String> |
headers |
int |
httpStatus |
String |
payload |
Constructor and Description |
---|
Response(Map<String,String> headers,
int httpStatus,
String payload) |
Modifier and Type | Method and Description |
---|---|
<T> T |
payloadAs(Class<T> clazz)
Parses response into Plain old Java objects.
|
String |
payloadAsPrettyString() |
String |
payloadAsString() |
<T> T |
payloadJsonAs(Class<T> clazz)
The payload of this request de-serialized into the specified class type.
|
<T> T |
payloadJsonAs(com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
The payload of this request de-serialized into the specified
TypeReference.
|
<T> T |
payloadXmlAs(Class<T> clazz)
The payload of this request de-serialized into the specified class type.
|
<T> T |
payloadXmlAs(com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
The payload of this request de-serialized into the specified
TypeReference.
|
public final int httpStatus
public final String payload
public String payloadAsString()
public String payloadAsPrettyString()
public <T> T payloadAs(Class<T> clazz)
clazz
- The class to use as blueprint for parsing the response body.public <T> T payloadXmlAs(Class<T> clazz)
clazz
- The class type that should be used to de-serialize the
payload.public <T> T payloadXmlAs(com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
typeReference
- The TypeReference that should be used to
de-serialize the payload.public <T> T payloadJsonAs(Class<T> clazz)
clazz
- The class type that should be used to de-serialize the
payload.public <T> T payloadJsonAs(com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
typeReference
- The TypeReference that should be used to de-serialize
the payload.Copyright © 2015. All Rights Reserved.