Skip to content

Commit d5642d9

Browse files
committed
Edit class Javadoc in Redis*Configuration classes.
Additionally, fix a few commpiler warnings and organize instance variables by type. Closes #2586
1 parent 6207a4f commit d5642d9

File tree

3 files changed

+32
-21
lines changed

3 files changed

+32
-21
lines changed

src/main/java/org/springframework/data/redis/connection/RedisClusterConfiguration.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
import org.springframework.util.StringUtils;
3636

3737
/**
38-
* Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using connecting
39-
* to <a href="https://redis.io/topics/cluster-spec">Redis Cluster</a>. Useful when setting up a high availability Redis
38+
* Configuration class used to set up a {@link RedisConnection} via {@link RedisConnectionFactory} for connecting
39+
* to <a href="https://redis.io/topics/cluster-spec">Redis Cluster</a>. Useful when setting up a highly available Redis
4040
* environment.
4141
*
4242
* @author Christoph Strobl
4343
* @author Mark Paluch
44+
* @author John Blum
4445
* @since 1.7
4546
*/
4647
public class RedisClusterConfiguration implements RedisConfiguration, ClusterConfiguration {
@@ -57,14 +58,14 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon
5758
private @Nullable String username = null;
5859

5960
/**
60-
* Creates new {@link RedisClusterConfiguration}.
61+
* Creates a new, default {@link RedisClusterConfiguration}.
6162
*/
6263
public RedisClusterConfiguration() {
6364
this(new MapPropertySource("RedisClusterConfiguration", Collections.emptyMap()));
6465
}
6566

6667
/**
67-
* Creates {@link RedisClusterConfiguration} for given hostPort combinations.
68+
* Creates a new {@link RedisClusterConfiguration} for given {@link String hostPort} combinations.
6869
*
6970
* <pre>
7071
* <code>
@@ -80,7 +81,8 @@ public RedisClusterConfiguration(Collection<String> clusterNodes) {
8081
}
8182

8283
/**
83-
* Creates {@link RedisClusterConfiguration} looking up values in given {@link PropertySource}.
84+
* Creates a new {@link RedisClusterConfiguration} looking up configuration values from the given
85+
* {@link PropertySource}.
8486
*
8587
* <pre>
8688
* <code>

src/main/java/org/springframework/data/redis/connection/RedisSentinelConfiguration.java

+15-10
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.data.redis.connection;
1717

18-
import static org.springframework.util.StringUtils.*;
18+
import static org.springframework.util.StringUtils.commaDelimitedListToSet;
1919

2020
import java.util.Collections;
2121
import java.util.HashMap;
@@ -32,14 +32,15 @@
3232
import org.springframework.util.StringUtils;
3333

3434
/**
35-
* Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using connecting
36-
* to <a href="https://redis.io/topics/sentinel">Redis Sentinel(s)</a>. Useful when setting up a high availability Redis
35+
* Configuration class used to set up a {@link RedisConnection} with {@link RedisConnectionFactory} for connecting
36+
* to <a href="https://redis.io/topics/sentinel">Redis Sentinel(s)</a>. Useful when setting up a highly available Redis
3737
* environment.
3838
*
3939
* @author Christoph Strobl
4040
* @author Thomas Darimont
4141
* @author Mark Paluch
4242
* @author Vikas Garg
43+
* @author John Blum
4344
* @since 1.4
4445
*/
4546
public class RedisSentinelConfiguration implements RedisConfiguration, SentinelConfiguration {
@@ -49,24 +50,27 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC
4950
private static final String REDIS_SENTINEL_USERNAME_CONFIG_PROPERTY = "spring.redis.sentinel.username";
5051
private static final String REDIS_SENTINEL_PASSWORD_CONFIG_PROPERTY = "spring.redis.sentinel.password";
5152

52-
private @Nullable NamedNode master;
53-
private Set<RedisNode> sentinels;
5453
private int database;
5554

56-
private @Nullable String dataNodeUsername = null;
57-
private @Nullable String sentinelUsername = null;
55+
private @Nullable NamedNode master;
56+
5857
private RedisPassword dataNodePassword = RedisPassword.none();
5958
private RedisPassword sentinelPassword = RedisPassword.none();
6059

60+
private final Set<RedisNode> sentinels;
61+
62+
private @Nullable String dataNodeUsername = null;
63+
private @Nullable String sentinelUsername = null;
64+
6165
/**
62-
* Creates new {@link RedisSentinelConfiguration}.
66+
* Creates a new, default {@link RedisSentinelConfiguration}.
6367
*/
6468
public RedisSentinelConfiguration() {
6569
this(new MapPropertySource("RedisSentinelConfiguration", Collections.emptyMap()));
6670
}
6771

6872
/**
69-
* Creates {@link RedisSentinelConfiguration} for given hostPort combinations.
73+
* Creates a new {@link RedisSentinelConfiguration} for given {@link String hostPort} combinations.
7074
*
7175
* <pre>
7276
* sentinelHostAndPorts[0] = 127.0.0.1:23679 sentinelHostAndPorts[1] = 127.0.0.1:23680 ...
@@ -80,7 +84,8 @@ public RedisSentinelConfiguration(String master, Set<String> sentinelHostAndPort
8084
}
8185

8286
/**
83-
* Creates {@link RedisSentinelConfiguration} looking up values in given {@link PropertySource}.
87+
* Creates a new {@link RedisSentinelConfiguration} looking up configuration values from the given
88+
* {@link PropertySource}.
8489
*
8590
* <pre>
8691
* <code>

src/main/java/org/springframework/data/redis/connection/RedisStandaloneConfiguration.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,29 @@
2323
import org.springframework.util.ObjectUtils;
2424

2525
/**
26-
* Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using connecting
27-
* to a single node <a href="https://redis.io/">Redis</a> installation.
26+
* Configuration class used to set up a {@link RedisConnection} with {@link RedisConnectionFactory} for connecting
27+
* to a single node <a href="https://redis.io/">Redis</a> instance.
2828
*
2929
* @author Mark Paluch
3030
* @author Christoph Strobl
31+
* @author John Blum
3132
* @since 2.0
3233
*/
3334
public class RedisStandaloneConfiguration
3435
implements RedisConfiguration, WithHostAndPort, WithPassword, WithDatabaseIndex {
3536

36-
private static final String DEFAULT_HOST = "localhost";
3737
private static final int DEFAULT_PORT = 6379;
3838

39-
private String hostName = DEFAULT_HOST;
40-
private int port = DEFAULT_PORT;
39+
private static final String DEFAULT_HOST = "localhost";
40+
4141
private int database;
42-
private @Nullable String username = null;
42+
private int port = DEFAULT_PORT;
43+
4344
private RedisPassword password = RedisPassword.none();
4445

46+
private String hostName = DEFAULT_HOST;
47+
private @Nullable String username = null;
48+
4549
/**
4650
* Create a new default {@link RedisStandaloneConfiguration}.
4751
*/

0 commit comments

Comments
 (0)