Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add javadoc to clear up implicit behavior #3991

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/java/redis/clients/jedis/Jedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,18 @@ public Jedis(final URI uri, final int connectionTimeout, final int soTimeout,
.hostnameVerifier(hostnameVerifier).build());
}

/**
* Create a new Jedis with the provided URI and JedisClientConfig object. Note that all fields
* that can be parsed from the URI will be used instead of the corresponding configuration values. This includes
* the following fields: user, password, database, protocol version, and whether to use SSL.
*
* For example, if the URI is "redis://user:password@localhost:6379/1", the user and password fields will be set
sazzad16 marked this conversation as resolved.
Show resolved Hide resolved
* to "user" and "password" respectively, the database field will be set to 1. If those fields are also set in
* the JedisClientConfig object, the URI values will take precedence.
joshrotenberg marked this conversation as resolved.
Show resolved Hide resolved
*
* @param uri The URI to connect to
* @param config The JedisClientConfig object to use
*/
public Jedis(final URI uri, JedisClientConfig config) {
if (!JedisURIHelper.isValid(uri)) {
throw new InvalidURIException(String.format(
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/redis/clients/jedis/UnifiedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ public UnifiedJedis(final URI uri) {
.ssl(JedisURIHelper.isRedisSSLScheme(uri)).build());
}

/**
* Create a new UnifiedJedis with the provided URI and JedisClientConfig object. Note that all fields
* that can be parsed from the URI will be used instead of the corresponding configuration values. This includes
* the following fields: user, password, database, protocol version, and whether to use SSL.
*
* For example, if the URI is "redis://user:password@localhost:6379/1", the user and password fields will be set
joshrotenberg marked this conversation as resolved.
Show resolved Hide resolved
* to "user" and "password" respectively, the database field will be set to 1. If those fields are also set in
* the JedisClientConfig object, the URI values will take precedence.
joshrotenberg marked this conversation as resolved.
Show resolved Hide resolved
*
* @param uri The URI to connect to
* @param config The JedisClientConfig object to use
*/
public UnifiedJedis(final URI uri, JedisClientConfig config) {
this(JedisURIHelper.getHostAndPort(uri), DefaultJedisClientConfig.builder()
.connectionTimeoutMillis(config.getConnectionTimeoutMillis())
Expand Down