public abstract class AlchemyService extends WatsonService
Modifier and Type | Field and Description |
---|---|
protected static String |
ENDPOINT
The Alchemy endpoint.
|
protected static String |
JSONP |
protected static String |
OUTPUT_MODE |
VERSION
Constructor and Description |
---|
AlchemyService()
Instantiates a new alchemy service.
|
Modifier and Type | Method and Description |
---|---|
protected com.squareup.okhttp.Response |
execute(com.squareup.okhttp.Request request)
Execute the HTTP request.
|
protected <T extends GenericModel> |
executeRequest(com.squareup.okhttp.Request request,
Class<T> returnType)
Executes the HTTP Request, reads and parses the HTTP Response.
|
protected String |
getInputFormat(Map<String,Object> params,
String... acceptedFormats)
Returns the first non-null accepted format from the parameter map.
|
protected void |
setAuthentication(com.squareup.okhttp.Request.Builder builder)
Sets the authentication.
|
configureHttpClient, executeWithoutResponse, getApiKey, getEndPoint, getName, getToken, setApiKey, setDefaultHeaders, setEndPoint, setUsernameAndPassword, toString
protected static final String ENDPOINT
protected static final String JSONP
protected static final String OUTPUT_MODE
protected com.squareup.okhttp.Response execute(com.squareup.okhttp.Request request)
WatsonService
execute
in class WatsonService
request
- the HTTP requestprotected <T extends GenericModel> T executeRequest(com.squareup.okhttp.Request request, Class<T> returnType)
WatsonService
executeRequest
in class WatsonService
T
- the POJO class that represents the responserequest
- the requestreturnType
- the return typeprotected String getInputFormat(Map<String,Object> params, String... acceptedFormats)
params
- the request parametersacceptedFormats
- the accepted formatsprotected void setAuthentication(com.squareup.okhttp.Request.Builder builder)
WatsonService
setAuthentication
in class WatsonService
builder
- the new authenticationCopyright © 2015–2016. All rights reserved.