Skip to content

Commit bea79a9

Browse files
Add javadoc to clear up implicit behavior (#3991)
* add javadoc to clear up implicit behavior * reword this paragraph
1 parent 8598275 commit bea79a9

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/main/java/redis/clients/jedis/Jedis.java

+12
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,18 @@ public Jedis(final URI uri, final int connectionTimeout, final int soTimeout,
193193
.hostnameVerifier(hostnameVerifier).build());
194194
}
195195

196+
/**
197+
* Create a new Jedis with the provided URI and JedisClientConfig object. Note that all fields
198+
* that can be parsed from the URI will be used instead of the corresponding configuration values. This includes
199+
* the following fields: user, password, database, protocol version, and whether to use SSL.
200+
*
201+
* For example, if the URI is "redis://user:password@localhost:6379/1", the user and password fields will be set
202+
* to "user" and "password" respectively, the database field will be set to 1. Those fields will be ignored
203+
* from the JedisClientConfig object.
204+
*
205+
* @param uri The URI to connect to
206+
* @param config The JedisClientConfig object to use
207+
*/
196208
public Jedis(final URI uri, JedisClientConfig config) {
197209
if (!JedisURIHelper.isValid(uri)) {
198210
throw new InvalidURIException(String.format(

src/main/java/redis/clients/jedis/UnifiedJedis.java

+12
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ public UnifiedJedis(final URI uri) {
8282
.ssl(JedisURIHelper.isRedisSSLScheme(uri)).build());
8383
}
8484

85+
/**
86+
* Create a new UnifiedJedis with the provided URI and JedisClientConfig object. Note that all fields
87+
* that can be parsed from the URI will be used instead of the corresponding configuration values. This includes
88+
* the following fields: user, password, database, protocol version, and whether to use SSL.
89+
*
90+
* For example, if the URI is "redis://user:password@localhost:6379/1", the user and password fields will be set
91+
* to "user" and "password" respectively, the database field will be set to 1. Those fields will be ignored
92+
* from the JedisClientConfig object.
93+
*
94+
* @param uri The URI to connect to
95+
* @param config The JedisClientConfig object to use
96+
*/
8597
public UnifiedJedis(final URI uri, JedisClientConfig config) {
8698
this(JedisURIHelper.getHostAndPort(uri), DefaultJedisClientConfig.builder()
8799
.connectionTimeoutMillis(config.getConnectionTimeoutMillis())

0 commit comments

Comments
 (0)