public abstract class AlchemyService extends WatsonService
Modifier and Type | Field and Description |
---|---|
protected static String |
ENDPOINT
The Constant ENDPOINT.
|
protected static String |
JSONP
The Constant JSONP.
|
protected static String |
OUTPUT_MODE
The Constant OUTPUT_MODE.
|
defaultHeaders, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION
Constructor and Description |
---|
AlchemyService()
Instantiates a new alchemy service.
|
AlchemyService(String apiKey)
Instantiates a new alchemy service by apiKey.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getInputFormat(Map<String,Object> params,
String... acceptedFormats)
Returns the first non-null accepted format from the parameter map.
|
protected <T> T |
processServiceCall(ResponseConverter<T> converter,
okhttp3.Response response)
Process service call.
|
protected void |
setAuthentication(okhttp3.Request.Builder builder)
Sets the authentication.
|
configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getToken, setApiKey, setDefaultHeaders, setEndPoint, setSkipAuthentication, setUsernameAndPassword, toString
protected static final String ENDPOINT
protected static final String JSONP
protected static final String OUTPUT_MODE
public AlchemyService()
public AlchemyService(String apiKey)
apiKey
- The API keyprotected <T> T processServiceCall(ResponseConverter<T> converter, okhttp3.Response response)
WatsonService
processServiceCall
in class WatsonService
T
- the generic typeconverter
- the converterresponse
- the responseprotected String getInputFormat(Map<String,Object> params, String... acceptedFormats)
params
- the request parametersacceptedFormats
- the accepted formatsprotected void setAuthentication(okhttp3.Request.Builder builder)
WatsonService
setAuthentication
in class WatsonService
builder
- the new authenticationCopyright © 2015–2016 IBM Watson. All rights reserved.