public class Mech2Result extends Object
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.HttpRequest |
getRequest() |
org.apache.http.HttpResponse |
getResponse() |
String |
getResponseBodyAsString() |
boolean |
isSuccess() |
Mech2Result |
orDie()
throw exception if the response doesn't have 2xx response.
|
<T> T |
parseJSON(Class<T> valueType) |
<T> T |
parseJSON(com.fasterxml.jackson.core.type.TypeReference<T> valueType) |
<T> Mech2JSONResult<T> |
toJSONResult(Class<T> valueType) |
<T> Mech2JSONResult<T> |
toJSONResult(com.fasterxml.jackson.core.type.TypeReference<T> klass) |
public org.apache.http.HttpRequest getRequest()
public org.apache.http.HttpResponse getResponse()
public boolean isSuccess()
public <T> Mech2JSONResult<T> toJSONResult(Class<T> valueType)
public <T> Mech2JSONResult<T> toJSONResult(com.fasterxml.jackson.core.type.TypeReference<T> klass)
public <T> T parseJSON(com.fasterxml.jackson.core.type.TypeReference<T> valueType)
throws com.fasterxml.jackson.core.JsonParseException,
com.fasterxml.jackson.databind.JsonMappingException,
IOException
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic <T> T parseJSON(Class<T> valueType) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionpublic Mech2Result orDie() throws Mech2FailException
Mech2FailExceptionpublic String getResponseBodyAsString() throws org.apache.http.ParseException, IOException
org.apache.http.ParseExceptionIOExceptionCopyright © 2014. All rights reserved.