Class WebSeedClientConfiguration.Builder
- java.lang.Object
-
- io.github.pr0methean.betterrandom.seed.WebSeedClientConfiguration.Builder
-
- Enclosing class:
- WebSeedClientConfiguration
public static class WebSeedClientConfiguration.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebSeedClientConfigurationbuild()Builds aWebSeedClientConfigurationwith this builder's parameters.WebSeedClientConfiguration.BuildersetProxy(Proxy proxy)Sets the proxy to use to connect to the server.WebSeedClientConfiguration.BuildersetRetryDelay(long amount, TimeUnit unit)Sets the delay after anIOExceptionbefore we will try connecting again.WebSeedClientConfiguration.BuildersetRetryDelay(Duration delay)Sets the delay after anIOExceptionbefore we will try connecting again.WebSeedClientConfiguration.BuildersetSocketFactory(SSLSocketFactory socketFactory)Sets theSSLSocketFactoryused to connect to the server.
-
-
-
Method Detail
-
setProxy
public WebSeedClientConfiguration.Builder setProxy(@Nullable Proxy proxy)
Sets the proxy to use to connect to the server.- Parameters:
proxy- the proxy, or null (default) to use the system default- Returns:
- this builder
-
setSocketFactory
public WebSeedClientConfiguration.Builder setSocketFactory(SSLSocketFactory socketFactory)
Sets theSSLSocketFactoryused to connect to the server.- Parameters:
socketFactory- the socket factory, or null (default) to use the system default- Returns:
- this builder
-
setRetryDelay
public WebSeedClientConfiguration.Builder setRetryDelay(Duration delay)
Sets the delay after anIOExceptionbefore we will try connecting again. ForRandomDotOrgApi2Client, this also controls the maximum "advisory delay" that will be honored. Attempting to use theWebSeedClientbefore the delay ends will throw aSeedException, so this is best used in aSeedGeneratorPreferenceList.- Parameters:
delay- the delay after a failed request- Returns:
- this builder
-
setRetryDelay
public WebSeedClientConfiguration.Builder setRetryDelay(long amount, TimeUnit unit)
Sets the delay after anIOExceptionbefore we will try connecting again. ForRandomDotOrgApi2Client, this also controls the maximum "advisory delay" that will be honored. Attempting to use theWebSeedClientbefore the delay ends will throw aSeedException, so this is best used in aSeedGeneratorPreferenceList.- Parameters:
amount- the number of units to delay byunit- the time unit in which the delay is measured- Returns:
- this builder
-
build
public WebSeedClientConfiguration build()
Builds aWebSeedClientConfigurationwith this builder's parameters.- Returns:
- a
WebSeedClientConfiguration
-
-