public abstract class StandaloneClientBuilder<C> extends AbstractClientBuilder<StandaloneClientBuilder<C>,C>
This builder provides methods specific to standalone Redis deployments, including host/port configuration, URI-based configuration, and client configuration options.
cache, cacheConfig, clientConfig, commandExecutor, commandObjects, connectionProvider, jsonObjectMapper, keyPreProcessor, poolConfig, searchDialect| Constructor and Description |
|---|
StandaloneClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected ConnectionProvider |
createDefaultConnectionProvider()
Creates a default connection provider based on the current configuration.
|
StandaloneClientBuilder<C> |
fromURI(java.lang.String uriString)
Deprecated.
Use
hostAndPort(String, int) combined with
AbstractClientBuilder.clientConfig(JedisClientConfig) for explicit configuration. This method
will be removed in Jedis 8.0.0.
Migration example:
// Old (deprecated):
builder.fromURI("redis://user:pass@localhost:6379/2")
// New (recommended):
builder.hostAndPort("localhost", 6379)
.clientConfig(DefaultJedisClientConfig.builder()
.user("user")
.password("pass")
.database(2)
.build())
|
StandaloneClientBuilder<C> |
fromURI(java.net.URI uri)
Deprecated.
Use
hostAndPort(HostAndPort) combined with
AbstractClientBuilder.clientConfig(JedisClientConfig) for explicit configuration. This method
will be removed in Jedis 8.0.0. See fromURI(String) for migration example. |
StandaloneClientBuilder<C> |
hostAndPort(HostAndPort hostAndPort)
Sets the Redis server host and port.
|
StandaloneClientBuilder<C> |
hostAndPort(java.lang.String host,
int port)
Sets the Redis server host and port.
|
protected StandaloneClientBuilder<C> |
self()
Returns the concrete builder instance for method chaining.
|
protected void |
validateSpecificConfiguration()
Validates the builder-specific configuration.
|
applyCommandObjectsConfiguration, build, cache, cacheConfig, clientConfig, commandExecutor, connectionProvider, createClient, createDefaultClientConfig, createDefaultCommandExecutor, createDefaultCommandObjects, jsonObjectMapper, keyPreProcessor, poolConfig, searchDialect, validateCommonConfigurationpublic StandaloneClientBuilder<C> hostAndPort(java.lang.String host, int port)
host - the Redis server hostnameport - the Redis server portpublic StandaloneClientBuilder<C> hostAndPort(HostAndPort hostAndPort)
hostAndPort - the Redis server host and portprotected StandaloneClientBuilder<C> self()
AbstractClientBuilderself in class AbstractClientBuilder<StandaloneClientBuilder<C>,C>protected ConnectionProvider createDefaultConnectionProvider()
AbstractClientBuildercreateDefaultConnectionProvider in class AbstractClientBuilder<StandaloneClientBuilder<C>,C>protected void validateSpecificConfiguration()
AbstractClientBuilderThis method is called by the generic build() method to validate configuration specific to each builder type. Implementations should call validateCommonConfiguration() and then perform their own specific validation.
validateSpecificConfiguration in class AbstractClientBuilder<StandaloneClientBuilder<C>,C>@Deprecated public StandaloneClientBuilder<C> fromURI(java.lang.String uriString)
hostAndPort(String, int) combined with
AbstractClientBuilder.clientConfig(JedisClientConfig) for explicit configuration. This method
will be removed in Jedis 8.0.0.
Migration example:
// Old (deprecated):
builder.fromURI("redis://user:pass@localhost:6379/2")
// New (recommended):
builder.hostAndPort("localhost", 6379)
.clientConfig(DefaultJedisClientConfig.builder()
.user("user")
.password("pass")
.database(2)
.build())
This method extracts connection parameters from the URI and merges them into the current client
configuration. If a client configuration was previously set via
AbstractClientBuilder.clientConfig(JedisClientConfig), only the values explicitly provided in the URI will
override the existing configuration. Values not present in the URI will be preserved from the
existing configuration.
This method sets:
URI values override existing config values when:
Examples:
// Credentials from config are preserved (URI has no credentials)
builder.clientConfig(configWithCredentials).fromURI("redis://localhost:6379")
// URI credentials override config credentials
builder.clientConfig(configWithCredentials).fromURI("redis://user:pass@localhost:6379")
// Config completely overrides URI (last wins)
builder.fromURI("redis://user:pass@localhost:6379").clientConfig(newConfig)
uriString - the Redis server URI string@Deprecated public StandaloneClientBuilder<C> fromURI(java.net.URI uri)
hostAndPort(HostAndPort) combined with
AbstractClientBuilder.clientConfig(JedisClientConfig) for explicit configuration. This method
will be removed in Jedis 8.0.0. See fromURI(String) for migration example.
This method extracts connection parameters from the URI and merges them into the current client
configuration. If a client configuration was previously set via
AbstractClientBuilder.clientConfig(JedisClientConfig), only the values explicitly provided in the URI will
override the existing configuration. Values not present in the URI will be preserved from the
existing configuration.
This method sets:
URI values override existing config values when:
Examples:
// Credentials from config are preserved (URI has no credentials) builder.clientConfig(configWithCredentials).fromURI(uri) // URI credentials override config credentials builder.clientConfig(configWithCredentials).fromURI(uriWithCredentials) // Config completely overrides URI (last wins) builder.fromURI(uriWithCredentials).clientConfig(newConfig)
uri - the Redis server URICopyright © 2026. All rights reserved.