public abstract class APIClientBuilder extends GenericAPIClientBuilder
apiKey, applicationId, connectTimeout, customAgent, customAgentVersion, customHeaders, objectMapper, random, readTimeout| Constructor and Description |
|---|
APIClientBuilder(String applicationId,
String apiKey)
Initialize this builder with the applicationId and apiKey
|
| Modifier and Type | Method and Description |
|---|---|
APIClient |
build()
Build the APIClient
|
protected abstract APIClient |
build(APIClientConfiguration configuration) |
GenericAPIClientBuilder |
setConnectTimeout(int connectTimeout)
Set the connect timeout of the HTTP client
|
GenericAPIClientBuilder |
setExtraHeader(String key,
String value)
Set extra headers to the requests
|
GenericAPIClientBuilder |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Set the Jackson ObjectMapper
|
GenericAPIClientBuilder |
setReadTimeout(int readTimeout)
Set the read timeout of the HTTP client
|
GenericAPIClientBuilder |
setUserAgent(String customAgent,
String customAgentVersion)
Customize the user agent
|
generateBuildHosts, generateHeaders, generateQueryHostspublic APIClientBuilder(@Nonnull String applicationId, @Nonnull String apiKey)
applicationId - APP_ID can be found on https://www.algolia.com/api-keysapiKey - Algolia API_KEY can also be found on https://www.algolia.com/api-keyspublic GenericAPIClientBuilder setUserAgent(@Nonnull String customAgent, @Nonnull String customAgentVersion)
setUserAgent in class GenericAPIClientBuildercustomAgent - key to add to the user agentcustomAgentVersion - value of this key to add to the user agentpublic GenericAPIClientBuilder setExtraHeader(@Nonnull String key, String value)
setExtraHeader in class GenericAPIClientBuilderkey - name of the headervalue - value of the headerpublic GenericAPIClientBuilder setConnectTimeout(int connectTimeout)
setConnectTimeout in class GenericAPIClientBuilderconnectTimeout - the value in mspublic GenericAPIClientBuilder setReadTimeout(int readTimeout)
setReadTimeout in class GenericAPIClientBuilderreadTimeout - the value in mspublic GenericAPIClientBuilder setObjectMapper(@Nonnull com.fasterxml.jackson.databind.ObjectMapper objectMapper)
setObjectMapper in class GenericAPIClientBuilderobjectMapper - the mapperprotected abstract APIClient build(@Nonnull APIClientConfiguration configuration)
public APIClient build()
Copyright © 2016. All rights reserved.