|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jakewharton.apibuilder.ApiService
com.jakewharton.domainr.DomainrApiService
public abstract class DomainrApiService
Domainr-specific API service extension which facilitates provides helper methods for performing remote method calls as well as deserializing the corresponding JSON responses.
Field Summary |
---|
Fields inherited from class com.jakewharton.apibuilder.ApiService |
---|
CONTENT_ENCODING |
Constructor Summary | |
---|---|
DomainrApiService()
Create a new Domainr service with our proper default values. |
Method Summary | ||
---|---|---|
com.google.gson.JsonObject |
get(String url)
Execute request using HTTP GET. |
|
protected com.google.gson.JsonObject |
unmarshall(InputStream jsonContent)
Read the entirety of an input stream and parse to a JSON object. |
|
protected
|
unmarshall(com.google.gson.reflect.TypeToken<T> typeToken,
com.google.gson.JsonElement response)
Use GSON to deserialize a JSON object to a native class representation. |
Methods inherited from class com.jakewharton.apibuilder.ApiService |
---|
acceptGzip, addRequestHeader, closeConnection, closeStream, convertStreamToString, executeDelete, executeDelete, executeGet, executeGet, executeMethod, executePost, executePost, getConnectTimeout, getParametersString, getReadTimeout, getWrappedInputStream, removeRequestHeader, setConnectTimeout, setReadTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DomainrApiService()
Method Detail |
---|
public com.google.gson.JsonObject get(String url)
url
- URL to request.
protected <T> T unmarshall(com.google.gson.reflect.TypeToken<T> typeToken, com.google.gson.JsonElement response)
T
- Native class type.typeToken
- Native class type wrapper.response
- Serialized JSON object.
protected com.google.gson.JsonObject unmarshall(InputStream jsonContent)
jsonContent
- JSON content input stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |