Class OkHttpClient.Builder
-
- All Implemented Interfaces:
public final class OkHttpClient.Builder
-
-
Method Summary
Modifier and Type Method Description final OkHttpClient.Buildertimeout(Timeout timeout)final OkHttpClient.Buildertimeout(Duration timeout)final OkHttpClient.Builderproxy(Proxy proxy)final OkHttpClient.Builderproxy(Optional<Proxy> proxy)Alias for calling Builder.proxy with proxy.orElse(null).final OkHttpClient.Builderbackend(Backend backend)final OkHttpClient.BuilderproxyAuthenticator(ProxyAuthenticator proxyAuthenticator)final OkHttpClient.BuilderproxyAuthenticator(Optional<ProxyAuthenticator> proxyAuthenticator)Alias for calling Builder.proxyAuthenticator with proxyAuthenticator.orElse(null).final OkHttpClient.BuildermaxIdleConnections(Integer maxIdleConnections)Sets the maximum number of idle connections kept by the underlying ConnectionPool. final OkHttpClient.BuildermaxIdleConnections(Optional<Integer> maxIdleConnections)Alias for calling Builder.maxIdleConnections with maxIdleConnections.orElse(null).final OkHttpClient.BuilderkeepAliveDuration(Duration keepAliveDuration)Sets the keep-alive duration for idle connections in the underlying ConnectionPool. final OkHttpClient.BuilderkeepAliveDuration(Optional<Duration> keepAliveDuration)Alias for calling Builder.keepAliveDuration with keepAliveDuration.orElse(null).final OkHttpClient.BuilderdispatcherExecutorService(ExecutorService dispatcherExecutorService)final OkHttpClient.BuilderdispatcherExecutorService(Optional<ExecutorService> dispatcherExecutorService)Alias for calling Builder.dispatcherExecutorService with dispatcherExecutorService.orElse(null).final OkHttpClient.BuildersslSocketFactory(SSLSocketFactory sslSocketFactory)final OkHttpClient.BuildersslSocketFactory(Optional<SSLSocketFactory> sslSocketFactory)Alias for calling Builder.sslSocketFactory with sslSocketFactory.orElse(null).final OkHttpClient.BuildertrustManager(X509TrustManager trustManager)final OkHttpClient.BuildertrustManager(Optional<X509TrustManager> trustManager)Alias for calling Builder.trustManager with trustManager.orElse(null).final OkHttpClient.BuilderhostnameVerifier(HostnameVerifier hostnameVerifier)final OkHttpClient.BuilderhostnameVerifier(Optional<HostnameVerifier> hostnameVerifier)Alias for calling Builder.hostnameVerifier with hostnameVerifier.orElse(null).final OkHttpClientbuild()-
-
Method Detail
-
timeout
final OkHttpClient.Builder timeout(Timeout timeout)
-
timeout
final OkHttpClient.Builder timeout(Duration timeout)
-
proxy
final OkHttpClient.Builder proxy(Proxy proxy)
-
proxy
final OkHttpClient.Builder proxy(Optional<Proxy> proxy)
Alias for calling Builder.proxy with
proxy.orElse(null).
-
backend
final OkHttpClient.Builder backend(Backend backend)
-
proxyAuthenticator
final OkHttpClient.Builder proxyAuthenticator(ProxyAuthenticator proxyAuthenticator)
-
proxyAuthenticator
final OkHttpClient.Builder proxyAuthenticator(Optional<ProxyAuthenticator> proxyAuthenticator)
Alias for calling Builder.proxyAuthenticator with
proxyAuthenticator.orElse(null).
-
maxIdleConnections
final OkHttpClient.Builder maxIdleConnections(Integer maxIdleConnections)
Sets the maximum number of idle connections kept by the underlying ConnectionPool.
If this is set, then keepAliveDuration must also be set.
If unset, then OkHttp's default is used.
-
maxIdleConnections
final OkHttpClient.Builder maxIdleConnections(Optional<Integer> maxIdleConnections)
Alias for calling Builder.maxIdleConnections with
maxIdleConnections.orElse(null).
-
keepAliveDuration
final OkHttpClient.Builder keepAliveDuration(Duration keepAliveDuration)
Sets the keep-alive duration for idle connections in the underlying ConnectionPool.
If this is set, then maxIdleConnections must also be set.
If unset, then OkHttp's default is used.
-
keepAliveDuration
final OkHttpClient.Builder keepAliveDuration(Optional<Duration> keepAliveDuration)
Alias for calling Builder.keepAliveDuration with
keepAliveDuration.orElse(null).
-
dispatcherExecutorService
final OkHttpClient.Builder dispatcherExecutorService(ExecutorService dispatcherExecutorService)
-
dispatcherExecutorService
final OkHttpClient.Builder dispatcherExecutorService(Optional<ExecutorService> dispatcherExecutorService)
Alias for calling Builder.dispatcherExecutorService with
dispatcherExecutorService.orElse(null).
-
sslSocketFactory
final OkHttpClient.Builder sslSocketFactory(SSLSocketFactory sslSocketFactory)
-
sslSocketFactory
final OkHttpClient.Builder sslSocketFactory(Optional<SSLSocketFactory> sslSocketFactory)
Alias for calling Builder.sslSocketFactory with
sslSocketFactory.orElse(null).
-
trustManager
final OkHttpClient.Builder trustManager(X509TrustManager trustManager)
-
trustManager
final OkHttpClient.Builder trustManager(Optional<X509TrustManager> trustManager)
Alias for calling Builder.trustManager with
trustManager.orElse(null).
-
hostnameVerifier
final OkHttpClient.Builder hostnameVerifier(HostnameVerifier hostnameVerifier)
-
hostnameVerifier
final OkHttpClient.Builder hostnameVerifier(Optional<HostnameVerifier> hostnameVerifier)
Alias for calling Builder.hostnameVerifier with
hostnameVerifier.orElse(null).
-
build
final OkHttpClient build()
-
-
-
-