public final class ResponseUtils extends Object
Response
Modifier and Type | Method and Description |
---|---|
static 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(String jsonString)
Returns a
JsonObject representation of the provided JSON String. |
static <T extends GenericModel> |
getObject(okhttp3.Response response,
Class<? extends T> type)
Parses the
Response into the POJO representation. |
static String |
getString(okhttp3.Response response)
Returns a String representation of the response.
|
public static 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(String jsonString)
JsonObject
representation of the provided JSON String.jsonString
- the JSON Stringpublic static <T extends GenericModel> T getObject(okhttp3.Response response, 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 String getString(okhttp3.Response response)
response
- an HTTP responseCopyright © 2015–2016 IBM Watson. All rights reserved.