public final class ClientOptionsBuilder extends Object
ClientOptions using the builder pattern.ClientBuilder| Constructor and Description |
|---|
ClientOptionsBuilder()
Deprecated.
|
ClientOptionsBuilder(ClientOptions options)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
B |
addHttpHeader(CharSequence name,
Object value)
Adds the specified HTTP header.
|
B |
addHttpHeaders(Iterable<? extends Map.Entry<? extends CharSequence,?>> httpHeaders)
Adds the specified HTTP headers.
|
ClientOptions |
build()
Returns a newly-created
ClientOptions based on the ClientOptionValues of this builder. |
B |
contentPreview(int length)
Sets the
ContentPreviewerFactory for creating a ContentPreviewer which produces the
preview with the maximum length limit for a request and a response. |
B |
contentPreview(int length,
Charset defaultCharset)
Sets the
ContentPreviewerFactory for creating a ContentPreviewer which produces the
preview with the maximum length limit for a request and a response. |
B |
contentPreviewerFactory(ContentPreviewerFactory factory)
Sets the
ContentPreviewerFactory for a request and a response. |
B |
decorator(DecoratingHttpClientFunction decorator)
Adds the specified HTTP-level
decorator. |
B |
decorator(Function<? super HttpClient,? extends HttpClient> decorator)
Adds the specified HTTP-level
decorator. |
B |
defaultMaxResponseLength(long maxResponseLength)
Deprecated.
|
B |
defaultResponseTimeout(Duration responseTimeout)
Deprecated.
|
B |
defaultResponseTimeoutMillis(long responseTimeoutMillis)
Deprecated.
|
B |
defaultWriteTimeout(Duration writeTimeout)
Deprecated.
|
B |
defaultWriteTimeoutMillis(long writeTimeoutMillis)
Deprecated.
|
B |
maxResponseLength(long maxResponseLength)
Sets the maximum allowed length of a server response in bytes.
|
<T> B |
option(ClientOption<T> option,
T value)
Adds the specified
ClientOption and its value. |
<T> B |
option(ClientOptionValue<T> optionValue)
Adds the specified
ClientOptionValue. |
B |
options(ClientOptions options)
Adds the specified
ClientOptions. |
B |
options(ClientOptionValue<?>... options)
Adds the specified
ClientOptionValues. |
B |
options(Iterable<ClientOptionValue<?>> options)
Adds the specified
ClientOptionValues. |
B |
requestContentPreviewerFactory(ContentPreviewerFactory factory)
Sets the
ContentPreviewerFactory for a request. |
B |
requestIdGenerator(Supplier<RequestId> requestIdGenerator)
|
B |
responseContentPreviewerFactory(ContentPreviewerFactory factory)
Sets the
ContentPreviewerFactory for a response. |
B |
responseTimeout(Duration responseTimeout)
Sets the timeout of a response.
|
B |
responseTimeoutMillis(long responseTimeoutMillis)
Sets the timeout of a response in milliseconds.
|
B |
rpcDecorator(DecoratingRpcClientFunction decorator)
Adds the specified RPC-level
decorator. |
B |
rpcDecorator(Function<? super RpcClient,? extends RpcClient> decorator)
Adds the specified RPC-level
decorator. |
B |
setHttpHeader(CharSequence name,
Object value)
Sets the specified HTTP header.
|
B |
setHttpHeaders(Iterable<? extends Map.Entry<? extends CharSequence,?>> httpHeaders)
Sets the specified HTTP headers.
|
B |
writeTimeout(Duration writeTimeout)
Sets the timeout of a socket write attempt.
|
B |
writeTimeoutMillis(long writeTimeoutMillis)
Sets the timeout of a socket write attempt in milliseconds.
|
@Deprecated public ClientOptionsBuilder()
ClientOptions.builder().@Deprecated public ClientOptionsBuilder(ClientOptions options)
ClientOptions.toBuilder().public ClientOptions build()
ClientOptions based on the ClientOptionValues of this builder.public B options(ClientOptions options)
ClientOptions.public B options(ClientOptionValue<?>... options)
ClientOptionValues.public B options(Iterable<ClientOptionValue<?>> options)
ClientOptionValues.public <T> B option(ClientOption<T> option, T value)
ClientOption and its value.public <T> B option(ClientOptionValue<T> optionValue)
ClientOptionValue.@Deprecated public B defaultWriteTimeout(Duration writeTimeout)
writeTimeout(Duration).writeTimeout - the timeout. 0 disables the timeout.@Deprecated public B defaultWriteTimeoutMillis(long writeTimeoutMillis)
writeTimeoutMillis(long).writeTimeoutMillis - the timeout in milliseconds. 0 disables the timeout.public B writeTimeout(Duration writeTimeout)
writeTimeout - the timeout. 0 disables the timeout.public B writeTimeoutMillis(long writeTimeoutMillis)
writeTimeoutMillis - the timeout in milliseconds. 0 disables the timeout.@Deprecated public B defaultResponseTimeout(Duration responseTimeout)
responseTimeout(Duration).responseTimeout - the timeout. 0 disables the timeout.@Deprecated public B defaultResponseTimeoutMillis(long responseTimeoutMillis)
responseTimeoutMillis(long).responseTimeoutMillis - the timeout in milliseconds. 0 disables the timeout.public B responseTimeout(Duration responseTimeout)
responseTimeout - the timeout. 0 disables the timeout.public B responseTimeoutMillis(long responseTimeoutMillis)
responseTimeoutMillis - the timeout in milliseconds. 0 disables the timeout.@Deprecated public B defaultMaxResponseLength(long maxResponseLength)
maxResponseLength(long).maxResponseLength - the maximum length in bytes. 0 disables the limit.public B maxResponseLength(long maxResponseLength)
maxResponseLength - the maximum length in bytes. 0 disables the limit.public B requestContentPreviewerFactory(ContentPreviewerFactory factory)
ContentPreviewerFactory for a request.public B responseContentPreviewerFactory(ContentPreviewerFactory factory)
ContentPreviewerFactory for a response.public B contentPreviewerFactory(ContentPreviewerFactory factory)
ContentPreviewerFactory for a request and a response.public B contentPreview(int length,
Charset defaultCharset)
ContentPreviewerFactory for creating a ContentPreviewer which produces the
preview with the maximum length limit for a request and a response.
The previewer is enabled only if the content type of a request/response meets
any of the following conditions:
text/* or application/x-www-form-urlencoded"xml" or "json""+xml" or "+json"length - the maximum length of the previewdefaultCharset - the default charset used when a charset is not specified in the
"content-type" headerpublic B contentPreview(int length)
ContentPreviewerFactory for creating a ContentPreviewer which produces the
preview with the maximum length limit for a request and a response.
The previewer is enabled only if the content type of a request/response meets
any of the following conditions:
text/* or application/x-www-form-urlencoded"xml" or "json""+xml" or "+json"length - the maximum length of the preview.public B decorator(Function<? super HttpClient,? extends HttpClient> decorator)
decorator.decorator - the Function that transforms an HttpClient to anotherpublic B decorator(DecoratingHttpClientFunction decorator)
decorator.decorator - the DecoratingHttpClientFunction that intercepts an invocationpublic B rpcDecorator(Function<? super RpcClient,? extends RpcClient> decorator)
decorator.public B rpcDecorator(DecoratingRpcClientFunction decorator)
decorator.decorator - the DecoratingRpcClientFunction that intercepts an invocationpublic B addHttpHeader(CharSequence name, Object value)
public B addHttpHeaders(Iterable<? extends Map.Entry<? extends CharSequence,?>> httpHeaders)
public B setHttpHeader(CharSequence name, Object value)
public B setHttpHeaders(Iterable<? extends Map.Entry<? extends CharSequence,?>> httpHeaders)
Copyright © 2020 LeanCloud. All rights reserved.