public final class ResponseUtils
extends java.lang.Object
Response
Modifier and Type | Method and Description |
---|---|
static java.io.InputStream |
getInputStream(okhttp3.Response response)
Returns the HTTP Response
InputStream . |
static com.google.gson.JsonElement |
getJsonElement(okhttp3.Response response)
Return a
JsonElement representation of the response. |
static com.google.gson.JsonObject |
getJsonObject(okhttp3.Response response)
Returns a
JsonObject representation of the response. |
static com.google.gson.JsonObject |
getJsonObject(java.lang.String jsonString)
Returns a
JsonObject representation of the provided JSON String. |
static <T extends ObjectModel> |
getObject(okhttp3.Response response,
java.lang.Class<? extends T> type)
Parses the
Response into the POJO representation. |
static java.lang.String |
getString(okhttp3.Response response)
Returns a String representation of the response.
|
public static java.io.InputStream getInputStream(okhttp3.Response response)
InputStream
.response
- an HTTP responsepublic static com.google.gson.JsonElement getJsonElement(okhttp3.Response response)
JsonElement
representation of the response.response
- the Responsepublic static com.google.gson.JsonObject getJsonObject(okhttp3.Response response)
JsonObject
representation of the response.response
- an HTTP responsepublic static com.google.gson.JsonObject getJsonObject(java.lang.String jsonString)
JsonObject
representation of the provided JSON String.jsonString
- the JSON Stringpublic static <T extends ObjectModel> T getObject(okhttp3.Response response, java.lang.Class<? extends T> type)
Response
into the POJO representation.T
- the generic type to use when parsing the responseresponse
- the HTTP responsetype
- the type of the responsepublic static java.lang.String getString(okhttp3.Response response)
response
- an HTTP response