Skip to content

Commit 4748a18

Browse files
committed
Polishing.
Refine Javadoc. See #3218
1 parent 8101a30 commit 4748a18

File tree

6 files changed

+44
-42
lines changed

6 files changed

+44
-42
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon
5353
private @Nullable String username = null;
5454

5555
/**
56-
* Creates a new, default {@link RedisClusterConfiguration}.
56+
* Creates a new, default {@code RedisClusterConfiguration}.
5757
*/
5858
public RedisClusterConfiguration() {}
5959

6060
/**
61-
* Creates a new {@link RedisClusterConfiguration} for given {@link String hostPort} combinations.
61+
* Creates a new {@code RedisClusterConfiguration} for given {@link String hostPort} combinations.
6262
*
6363
* <pre class="code">
6464
* clusterHostAndPorts[0] = 127.0.0.1:23679
@@ -74,7 +74,7 @@ public RedisClusterConfiguration(Collection<String> clusterNodes) {
7474
}
7575

7676
/**
77-
* Creates a new {@link RedisClusterConfiguration} looking up configuration values from the given
77+
* Creates a new {@code RedisClusterConfiguration} looking up configuration values from the given
7878
* {@link PropertySource}.
7979
*
8080
* <pre class="code">
@@ -83,7 +83,7 @@ public RedisClusterConfiguration(Collection<String> clusterNodes) {
8383
* </pre>
8484
*
8585
* @param propertySource must not be {@literal null}.
86-
* @return a new {@link RedisClusterConfiguration} configured from the given {@link PropertySource}.
86+
* @return a new {@code RedisClusterConfiguration} configured from the given {@link PropertySource}.
8787
* @since 3.3
8888
*/
8989
public static RedisClusterConfiguration of(PropertySource<?> propertySource) {

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
/**
2929
* Marker interface for configuration classes related to Redis connection setup. As the setup scenarios are quite
30-
* diverse instead of struggling with unifying those, {@link RedisConfiguration} provides means to identify
30+
* diverse instead of struggling with unifying those, {@code RedisConfiguration} provides means to identify
3131
* configurations for the individual purposes.
3232
*
3333
* @author Christoph Strobl
@@ -38,11 +38,11 @@
3838
public interface RedisConfiguration {
3939

4040
/**
41-
* Get the configured database index if the current {@link RedisConfiguration} is
41+
* Get the configured database index if the current {@code RedisConfiguration} is
4242
* {@link #isDatabaseIndexAware(RedisConfiguration) database aware} or evaluate and return the value of the given
4343
* {@link Supplier}.
4444
*
45-
* @param other a {@code Supplier} whose result is returned if given {@link RedisConfiguration} is not
45+
* @param other a {@code Supplier} whose result is returned if given {@code RedisConfiguration} is not
4646
* {@link #isDatabaseIndexAware(RedisConfiguration) database aware}.
4747
* @return never {@literal null}.
4848
* @throws IllegalArgumentException if {@code other} is {@literal null}.
@@ -52,11 +52,11 @@ default Integer getDatabaseOrElse(Supplier<Integer> other) {
5252
}
5353

5454
/**
55-
* Get the configured {@link RedisPassword} if the current {@link RedisConfiguration} is
55+
* Get the configured {@link RedisPassword} if the current {@code RedisConfiguration} is
5656
* {@link #isAuthenticationAware(RedisConfiguration) password aware} or evaluate and return the value of the given
5757
* {@link Supplier}.
5858
*
59-
* @param other a {@code Supplier} whose result is returned if given {@link RedisConfiguration} is not
59+
* @param other a {@code Supplier} whose result is returned if given {@code RedisConfiguration} is not
6060
* {@link #isAuthenticationAware(RedisConfiguration) password aware}.
6161
* @return never {@literal null}.
6262
* @throws IllegalArgumentException if {@code other} is {@literal null}.
@@ -67,7 +67,7 @@ default RedisPassword getPasswordOrElse(Supplier<RedisPassword> other) {
6767

6868
/**
6969
* @param configuration can be {@literal null}.
70-
* @return {@code true} if given {@link RedisConfiguration} is instance of {@link WithPassword}.
70+
* @return {@code true} if given {@code RedisConfiguration} is instance of {@link WithPassword}.
7171
*/
7272
@Contract("null -> false")
7373
static boolean isAuthenticationAware(@Nullable RedisConfiguration configuration) {
@@ -76,7 +76,7 @@ static boolean isAuthenticationAware(@Nullable RedisConfiguration configuration)
7676

7777
/**
7878
* @param configuration can be {@literal null}.
79-
* @return {@code true} if given {@link RedisConfiguration} is instance of {@link WithDatabaseIndex}.
79+
* @return {@code true} if given {@code RedisConfiguration} is instance of {@link WithDatabaseIndex}.
8080
*/
8181
@Contract("null -> false")
8282
static boolean isDatabaseIndexAware(@Nullable RedisConfiguration configuration) {
@@ -85,7 +85,7 @@ static boolean isDatabaseIndexAware(@Nullable RedisConfiguration configuration)
8585

8686
/**
8787
* @param configuration can be {@literal null}.
88-
* @return {@code true} if given {@link RedisConfiguration} is instance of {@link SentinelConfiguration}.
88+
* @return {@code true} if given {@code RedisConfiguration} is instance of {@link SentinelConfiguration}.
8989
*/
9090
@Contract("null -> false")
9191
static boolean isSentinelConfiguration(@Nullable RedisConfiguration configuration) {
@@ -94,7 +94,7 @@ static boolean isSentinelConfiguration(@Nullable RedisConfiguration configuratio
9494

9595
/**
9696
* @param configuration can be {@literal null}.
97-
* @return {@code true} if given {@link RedisConfiguration} is instance of {@link WithHostAndPort}.
97+
* @return {@code true} if given {@code RedisConfiguration} is instance of {@link WithHostAndPort}.
9898
* @since 2.1.6
9999
*/
100100
@Contract("null -> false")
@@ -104,7 +104,7 @@ static boolean isHostAndPortAware(@Nullable RedisConfiguration configuration) {
104104

105105
/**
106106
* @param configuration can be {@literal null}.
107-
* @return {@code true} if given {@link RedisConfiguration} is instance of {@link ClusterConfiguration}.
107+
* @return {@code true} if given {@code RedisConfiguration} is instance of {@link ClusterConfiguration}.
108108
*/
109109
@Contract("null -> false")
110110
static boolean isClusterConfiguration(@Nullable RedisConfiguration configuration) {
@@ -113,7 +113,7 @@ static boolean isClusterConfiguration(@Nullable RedisConfiguration configuration
113113

114114
/**
115115
* @param configuration can be {@literal null}.
116-
* @return {@code true} if given {@link RedisConfiguration} is instance of {@link StaticMasterReplicaConfiguration}.
116+
* @return {@code true} if given {@code RedisConfiguration} is instance of {@link StaticMasterReplicaConfiguration}.
117117
*/
118118
@Contract("null -> false")
119119
static boolean isStaticMasterReplicaConfiguration(@Nullable RedisConfiguration configuration) {
@@ -122,7 +122,7 @@ static boolean isStaticMasterReplicaConfiguration(@Nullable RedisConfiguration c
122122

123123
/**
124124
* @param configuration can be {@literal null}.
125-
* @return {@code true} if given {@link RedisConfiguration} is instance of {@link DomainSocketConfiguration}.
125+
* @return {@code true} if given {@code RedisConfiguration} is instance of {@link DomainSocketConfiguration}.
126126
*/
127127
@Contract("null -> false")
128128
static boolean isDomainSocketConfiguration(@Nullable RedisConfiguration configuration) {
@@ -131,7 +131,7 @@ static boolean isDomainSocketConfiguration(@Nullable RedisConfiguration configur
131131

132132
/**
133133
* @param configuration can be {@literal null}.
134-
* @param other a {@code Supplier} whose result is returned if given {@link RedisConfiguration} is not
134+
* @param other a {@code Supplier} whose result is returned if given {@code RedisConfiguration} is not
135135
* {@link #isDatabaseIndexAware(RedisConfiguration) database aware}.
136136
* @return never {@literal null}.
137137
* @throws IllegalArgumentException if {@code other} is {@literal null}.
@@ -144,7 +144,7 @@ static Integer getDatabaseOrElse(@Nullable RedisConfiguration configuration, Sup
144144

145145
/**
146146
* @param configuration can be {@literal null}.
147-
* @param other a {@code Supplier} whose result is returned if given {@link RedisConfiguration} is not
147+
* @param other a {@code Supplier} whose result is returned if given {@code RedisConfiguration} is not
148148
* {@link #isAuthenticationAware(RedisConfiguration) password aware}.
149149
* @return can be {@literal null}.
150150
* @throws IllegalArgumentException if {@code other} is {@literal null}.
@@ -158,7 +158,7 @@ static Integer getDatabaseOrElse(@Nullable RedisConfiguration configuration, Sup
158158

159159
/**
160160
* @param configuration can be {@literal null}.
161-
* @param other a {@code Supplier} whose result is returned if given {@link RedisConfiguration} is not
161+
* @param other a {@code Supplier} whose result is returned if given {@code RedisConfiguration} is not
162162
* {@link #isAuthenticationAware(RedisConfiguration) password aware}.
163163
* @return never {@literal null}.
164164
* @throws IllegalArgumentException if {@code other} is {@literal null}.
@@ -171,7 +171,7 @@ static RedisPassword getPasswordOrElse(@Nullable RedisConfiguration configuratio
171171

172172
/**
173173
* @param configuration can be {@literal null}.
174-
* @param other a {@code Supplier} whose result is returned if given {@link RedisConfiguration} is not
174+
* @param other a {@code Supplier} whose result is returned if given {@code RedisConfiguration} is not
175175
* {@link #isHostAndPortAware(RedisConfiguration) port aware}.
176176
* @return never {@literal null}.
177177
* @throws IllegalArgumentException if {@code other} is {@literal null}.
@@ -185,7 +185,7 @@ static int getPortOrElse(@Nullable RedisConfiguration configuration, IntSupplier
185185

186186
/**
187187
* @param configuration can be {@literal null}.
188-
* @param other a {@code Supplier} whose result is returned if given {@link RedisConfiguration} is not
188+
* @param other a {@code Supplier} whose result is returned if given {@code RedisConfiguration} is not
189189
* {@link #isHostAndPortAware(RedisConfiguration) host aware}.
190190
* @return never {@literal null}.
191191
* @throws IllegalArgumentException if {@code other} is {@literal null}.
@@ -198,7 +198,7 @@ static String getHostOrElse(@Nullable RedisConfiguration configuration, Supplier
198198
}
199199

200200
/**
201-
* {@link RedisConfiguration} part suitable for configurations that may use authentication when connecting.
201+
* {@code RedisConfiguration} part suitable for configurations that may use authentication when connecting.
202202
*
203203
* @author Christoph Strobl
204204
* @author Mark Paluch
@@ -255,7 +255,7 @@ default void setPassword(char @Nullable[] password) {
255255
}
256256

257257
/**
258-
* {@link RedisConfiguration} part suitable for configurations that may use authentication when connecting.
258+
* {@code RedisConfiguration} part suitable for configurations that may use authentication when connecting.
259259
*
260260
* @author Christoph Strobl
261261
* @since 2.1
@@ -265,7 +265,7 @@ interface WithPassword extends WithAuthentication {
265265
}
266266

267267
/**
268-
* {@link RedisConfiguration} part suitable for configurations that use a specific database.
268+
* {@code RedisConfiguration} part suitable for configurations that use a specific database.
269269
*
270270
* @author Christoph Strobl
271271
* @since 2.1
@@ -288,7 +288,7 @@ interface WithDatabaseIndex {
288288
}
289289

290290
/**
291-
* {@link RedisConfiguration} part suitable for configurations that use host/port combinations for connecting.
291+
* {@code RedisConfiguration} part suitable for configurations that use host/port combinations for connecting.
292292
*
293293
* @author Christoph Strobl
294294
* @since 2.1
@@ -323,7 +323,7 @@ interface WithHostAndPort {
323323
}
324324

325325
/**
326-
* {@link RedisConfiguration} part suitable for configurations that use native domain sockets for connecting.
326+
* {@code RedisConfiguration} part suitable for configurations that use native domain sockets for connecting.
327327
*
328328
* @author Christoph Strobl
329329
* @since 2.1

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC
6868
private @Nullable String sentinelUsername = null;
6969

7070
/**
71-
* Creates a new, default {@link RedisSentinelConfiguration}.
71+
* Creates a new, default {@code RedisSentinelConfiguration}.
7272
*/
7373
public RedisSentinelConfiguration() {
7474
}
7575

7676
/**
77-
* Creates a new {@link RedisSentinelConfiguration} for given {@link String hostPort} combinations.
77+
* Creates a new {@code RedisSentinelConfiguration} for given {@link String hostPort} combinations.
7878
*
7979
* <pre class="code">
8080
* sentinelHostAndPorts[0] = 127.0.0.1:23679
@@ -97,10 +97,10 @@ public RedisSentinelConfiguration(String master, Set<String> sentinelHostAndPort
9797
}
9898

9999
/**
100-
* Construct a new {@link RedisSentinelConfiguration} from the given {@link PropertySource}.
100+
* Construct a new {@code RedisSentinelConfiguration} from the given {@link PropertySource}.
101101
*
102102
* @param propertySource must not be {@literal null}.
103-
* @return a new {@link RedisSentinelConfiguration} configured from the given {@link PropertySource}.
103+
* @return a new {@code RedisSentinelConfiguration} configured from the given {@link PropertySource}.
104104
* @since 3.3
105105
*/
106106
public static RedisSentinelConfiguration of(PropertySource<?> propertySource) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ public class RedisSocketConfiguration implements RedisConfiguration, DomainSocke
3838
private RedisPassword password = RedisPassword.none();
3939

4040
/**
41-
* Create a new default {@link RedisSocketConfiguration}.
41+
* Create a new default {@code RedisSocketConfiguration}.
4242
*/
4343
public RedisSocketConfiguration() {}
4444

4545
/**
46-
* Create a new {@link RedisSocketConfiguration} given {@code socket}.
46+
* Create a new {@code RedisSocketConfiguration} given {@code socket}.
4747
*
4848
* @param socket must not be {@literal null} or empty.
4949
*/

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ public class RedisStandaloneConfiguration
4747
private @Nullable String username = null;
4848

4949
/**
50-
* Create a new default {@link RedisStandaloneConfiguration}.
50+
* Create a new default {@code RedisStandaloneConfiguration}.
5151
*/
5252
public RedisStandaloneConfiguration() {}
5353

5454
/**
55-
* Create a new {@link RedisStandaloneConfiguration} given {@code hostName}.
55+
* Create a new {@code RedisStandaloneConfiguration} given {@code hostName}.
5656
*
5757
* @param hostName must not be {@literal null} or empty.
5858
*/
@@ -61,7 +61,7 @@ public RedisStandaloneConfiguration(String hostName) {
6161
}
6262

6363
/**
64-
* Create a new {@link RedisStandaloneConfiguration} given {@code hostName} and {@code port}.
64+
* Create a new {@code RedisStandaloneConfiguration} given {@code hostName} and {@code port}.
6565
*
6666
* @param hostName must not be {@literal null} or empty.
6767
* @param port a valid TCP port (1-65535).

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626

2727
/**
2828
* Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using the provided
29-
* Master / Replica configuration to nodes know to not change address. Eg. when connecting to
30-
* <a href="https://aws.amazon.com/documentation/elasticache/">AWS ElastiCache with Read Replicas</a>. <br/>
31-
* Please also note that a Master/Replica connection cannot be used for Pub/Sub operations.
29+
* Master / Replica configuration to nodes know to not change address. Useful when connecting to
30+
* <a href="https://aws.amazon.com/documentation/elasticache/">AWS ElastiCache with Read Replicas</a>.
31+
* <p>
32+
* A Master/Replica connection cannot be used for Pub/Sub operations as Pub/Sub messages are not broadcasted across
33+
* replicas. Pub/Sub broadcasting is only available using {@link RedisClusterConfiguration Redis Cluster}.
3234
*
3335
* @author Mark Paluch
3436
* @author Christoph Strobl
@@ -52,7 +54,7 @@ public class RedisStaticMasterReplicaConfiguration implements RedisConfiguration
5254
public RedisStaticMasterReplicaConfiguration() {}
5355

5456
/**
55-
* Create a new {@link StaticMasterReplicaConfiguration} given {@code hostName}.
57+
* Create a new {@code StaticMasterReplicaConfiguration} given {@code hostName}.
5658
*
5759
* @param hostName must not be {@literal null} or empty.
5860
*/
@@ -61,7 +63,7 @@ public RedisStaticMasterReplicaConfiguration(String hostName) {
6163
}
6264

6365
/**
64-
* Create a new {@link StaticMasterReplicaConfiguration} given {@code hostName} and {@code port}.
66+
* Create a new {@code StaticMasterReplicaConfiguration} given {@code hostName} and {@code port}.
6567
*
6668
* @param hostName must not be {@literal null} or empty.
6769
* @param port a valid TCP port (1-65535).
@@ -98,7 +100,7 @@ private void addNode(RedisStandaloneConfiguration node) {
98100
* Add a {@link RedisStandaloneConfiguration node} to the list of nodes given {@code hostName}.
99101
*
100102
* @param hostName must not be {@literal null} or empty.
101-
* @return {@code this} {@link StaticMasterReplicaConfiguration}.
103+
* @return {@code this} {@code StaticMasterReplicaConfiguration}.
102104
*/
103105
public RedisStaticMasterReplicaConfiguration node(String hostName) {
104106
return node(hostName, DEFAULT_PORT);
@@ -109,7 +111,7 @@ public RedisStaticMasterReplicaConfiguration node(String hostName) {
109111
*
110112
* @param hostName must not be {@literal null} or empty.
111113
* @param port a valid TCP port (1-65535).
112-
* @return {@code this} {@link StaticMasterReplicaConfiguration}.
114+
* @return {@code this} {@code StaticMasterReplicaConfiguration}.
113115
*/
114116
public RedisStaticMasterReplicaConfiguration node(String hostName, int port) {
115117

0 commit comments

Comments
 (0)