public class ResponseUtil extends Object
Response| Constructor and Description |
|---|
ResponseUtil() |
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
getInputStream(com.squareup.okhttp.Response response)
Returns the HTTP Response
InputStream. |
static com.google.gson.JsonElement |
getJsonElement(com.squareup.okhttp.Response response)
Return a
JsonElement representation of the response. |
static com.google.gson.JsonObject |
getJsonObject(com.squareup.okhttp.Response response)
Returns a
JsonObject representation of the response. |
static com.google.gson.JsonObject |
getJsonObject(String jsonString)
Returns a
JsonObject representation of the provided JSON. |
static <T extends GenericModel> |
getObject(com.squareup.okhttp.Response response,
Class<T> type)
Parses the response into the POJO representation
|
static String |
getResponseString(com.squareup.okhttp.Response response)
Returns the HTTP Response as a
String. |
static String |
getString(com.squareup.okhttp.Response response)
Returns a String representation of the response.
|
public static InputStream getInputStream(com.squareup.okhttp.Response response)
InputStream.response - an HTTP responsepublic static String getResponseString(com.squareup.okhttp.Response response)
String.response - an HTTP responsepublic static com.google.gson.JsonElement getJsonElement(com.squareup.okhttp.Response response)
JsonElement representation of the response.response - the Responsepublic static com.google.gson.JsonObject getJsonObject(com.squareup.okhttp.Response response)
JsonObject representation of the response.response - an HTTP responsepublic static com.google.gson.JsonObject getJsonObject(String jsonString)
JsonObject representation of the provided JSON.jsonString - the JSON Stringpublic static <T extends GenericModel> T getObject(com.squareup.okhttp.Response response, Class<T> type)
T - the generic type to use when parsing the responseresponse - the HTTP responsetype - the type of the responsepublic static String getString(com.squareup.okhttp.Response response)
response - an HTTP responseCopyright © 2015–2016. All rights reserved.