public abstract static class ConfigBase.Builder<T extends ConfigBase.Builder<T>> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected CompressionType |
compressionType |
| Constructor and Description |
|---|
Builder(String applicationID,
String apiKey,
List<StatefulHost> defaultHosts,
CompressionType compressionType)
Builds a base configuration
|
| Modifier and Type | Method and Description |
|---|---|
T |
addExtraHeaders(Map<String,String> headers)
Copies all of the mappings from the specified map to this map.
|
T |
addExtraHeaders(String headerKey,
String headerValue)
Associates the specified value with the specified key in this map.
|
abstract T |
getThis()
To prevent unchecked cast warning.
|
T |
setBatchSize(int batchSize)
Overrides the default batch size for save methods.
|
T |
setConnectTimeOut(Integer connectTimeOut)
Overrides the default connect timeout.
|
T |
setExecutorService(ExecutorService executorService)
Sets a custom executor service.
|
T |
setHosts(List<StatefulHost> customHosts)
Sets a list of specific host to target.
|
T |
setReadTimeOut(Integer readTimeOut)
Overrides the default read timeout.
|
T |
setWriteTimeOut(Integer writeTimeOut)
Overrides the default write timeout.
|
protected CompressionType compressionType
public Builder(@Nonnull String applicationID, @Nonnull String apiKey, @Nonnull List<StatefulHost> defaultHosts, @Nonnull CompressionType compressionType)
applicationID - The Algolia Application IDapiKey - The API Key: could be Admin API Key or Search API KeyNullPointerException - If the ApplicationID or the APIKey or the hosts are nullIllegalArgumentException - If the ApplicationID or the APIKey are emptypublic abstract T getThis()
public T setBatchSize(int batchSize)
public T setReadTimeOut(Integer readTimeOut)
public T setWriteTimeOut(Integer writeTimeOut)
public T setConnectTimeOut(Integer connectTimeOut)
public T setHosts(@Nonnull List<StatefulHost> customHosts)
public T setExecutorService(ExecutorService executorService)
public T addExtraHeaders(@Nonnull String headerKey, @Nonnull String headerValue)
Copyright © 2019. All rights reserved.