public abstract class Request extends Object
Base class for all WSAPI requests.
Subclasses classes should provide an implementation oftoUrl()
Modifier and Type | Field and Description |
---|---|
protected com.google.gson.GsonBuilder |
gsonBuilder
Gson Builder used for JSON serialization in this request.
|
Constructor and Description |
---|
Request()
Create a new request.
|
Modifier and Type | Method and Description |
---|---|
void |
addParam(String name,
String value)
Add the specified parameter to this request.
|
com.google.gson.GsonBuilder |
getGsonBuilder()
Get the Gson Builder used for JSON serialization in this request.
|
List<org.apache.http.NameValuePair> |
getParams()
Get the list of additional parameters included in this request.
|
void |
setGsonBuilder(com.google.gson.GsonBuilder gsonBuilder)
Set the Gson Builder used for JSON serialization in this request.
|
void |
setParams(List<org.apache.http.NameValuePair> params)
Set the list of additional parameters included in this request.
|
abstract String |
toUrl()
Convert this request into a url compatible with the WSAPI.
|
protected com.google.gson.GsonBuilder gsonBuilder
public List<org.apache.http.NameValuePair> getParams()
public void setParams(List<org.apache.http.NameValuePair> params)
params
- The list of additional parameterspublic void addParam(String name, String value)
name
- the parameter namevalue
- the parameter valuepublic com.google.gson.GsonBuilder getGsonBuilder()
public void setGsonBuilder(com.google.gson.GsonBuilder gsonBuilder)
gsonBuilder
- The Gson Builder used for JSON serializationpublic abstract String toUrl()
Convert this request into a url compatible with the WSAPI.
Must be implemented by subclasses.Copyright © 2016. All Rights Reserved.