public final class ClientOptions extends AbstractOptions
ClientOptions and their respective values.| Modifier and Type | Field and Description |
|---|---|
static ClientOptions |
DEFAULT
Deprecated.
Use
of(). |
| Modifier and Type | Method and Description |
|---|---|
Map<ClientOption<Object>,ClientOptionValue<Object>> |
asMap()
Converts this
ClientOptions to a Map. |
static ClientOptionsBuilder |
builder()
Returns a newly created
ClientOptionsBuilder. |
ClientDecoration |
decoration()
Returns the
Functions that decorate the components of a client. |
long |
defaultMaxResponseLength()
Deprecated.
Use
maxResponseLength(). |
long |
defaultResponseTimeoutMillis1()
Deprecated.
|
long |
defaultWriteTimeoutMillis()
Deprecated.
Use
writeTimeoutMillis(). |
Function<? super Endpoint,? extends EndpointGroup> |
endpointRemapper()
|
ClientFactory |
factory()
Returns the
ClientFactory used for creating a client. |
<T> T |
get(ClientOption<T> option)
Returns the value of the specified
ClientOption. |
<T> T |
getOrElse(ClientOption<T> option,
T defaultValue)
Returns the value of the specified
ClientOption. |
<T> T |
getOrNull(ClientOption<T> option)
Returns the value of the specified
ClientOption. |
HttpHeaders |
httpHeaders()
Returns the additional HTTP headers to send with requests.
|
long |
maxResponseLength()
Returns the maximum allowed length of a server response.
|
static ClientOptions |
of()
Returns the
ClientOptions with the default options only. |
static ClientOptions |
of(ClientOptions baseOptions,
ClientOptions options)
Merges the specified two
ClientOptions into one. |
static ClientOptions |
of(ClientOptions baseOptions,
ClientOptionValue<?>... options)
Merges the specified
ClientOptions and ClientOptionValues. |
static ClientOptions |
of(ClientOptions baseOptions,
Iterable<ClientOptionValue<?>> options)
Merges the specified
ClientOptions and ClientOptionValues. |
static ClientOptions |
of(ClientOptionValue<?>... options)
Returns the
ClientOptions with the specified ClientOptionValues. |
static ClientOptions |
of(Iterable<ClientOptionValue<?>> options)
Returns the
ClientOptions with the specified ClientOptionValues. |
Supplier<RequestId> |
requestIdGenerator()
|
long |
responseTimeoutMillis()
Returns the timeout of a server reply to a client call.
|
ClientOptionsBuilder |
toBuilder()
Returns a new
ClientOptionsBuilder created from this ClientOptions. |
long |
writeTimeoutMillis()
Returns the timeout of a socket write.
|
asMap0, get0, getOrElse0, getOrNull0, toString@Deprecated public static final ClientOptions DEFAULT
of().ClientOptions.public static ClientOptions of()
ClientOptions with the default options only.public static ClientOptions of(ClientOptionValue<?>... options)
ClientOptions with the specified ClientOptionValues.public static ClientOptions of(Iterable<ClientOptionValue<?>> options)
ClientOptions with the specified ClientOptionValues.public static ClientOptions of(ClientOptions baseOptions, ClientOptionValue<?>... options)
ClientOptions and ClientOptionValues.ClientOptionspublic static ClientOptions of(ClientOptions baseOptions, Iterable<ClientOptionValue<?>> options)
ClientOptions and ClientOptionValues.ClientOptionspublic static ClientOptions of(ClientOptions baseOptions, ClientOptions options)
ClientOptions into one.ClientOptionspublic static ClientOptionsBuilder builder()
ClientOptionsBuilder.public <T> T get(ClientOption<T> option)
ClientOption.ClientOptionNoSuchElementException - if no value is set for the specified ClientOption.public <T> T getOrNull(ClientOption<T> option)
ClientOption.ClientOption, or
null if the specified ClientOption is not set.public <T> T getOrElse(ClientOption<T> option, T defaultValue)
ClientOption.ClientOption, or
defaultValue if the specified ClientOption is not set.public Map<ClientOption<Object>,ClientOptionValue<Object>> asMap()
ClientOptions to a Map.public ClientFactory factory()
ClientFactory used for creating a client.@Deprecated public long defaultWriteTimeoutMillis()
writeTimeoutMillis().public long writeTimeoutMillis()
@Deprecated public long defaultResponseTimeoutMillis1()
responseTimeoutMillis().public long responseTimeoutMillis()
@Deprecated public long defaultMaxResponseLength()
maxResponseLength().public long maxResponseLength()
public ClientDecoration decoration()
Functions that decorate the components of a client.public HttpHeaders httpHeaders()
SessionProtocol is HTTP.public Function<? super Endpoint,? extends EndpointGroup> endpointRemapper()
ClientBuilder.endpointRemapper(Function)public ClientOptionsBuilder toBuilder()
ClientOptionsBuilder created from this ClientOptions.Copyright © 2020 LeanCloud. All rights reserved.