Skip to content

Commit 928a786

Browse files
committed
Polishing.
Consistently use literal null. See #3010
1 parent 943bb8f commit 928a786

22 files changed

+42
-42
lines changed

src/main/java/org/springframework/data/redis/cache/DefaultRedisCacheWriter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ interface AsyncCacheWriter {
429429
* @param name the cache name from which to retrieve the cache entry.
430430
* @param key the cache entry key.
431431
* @param ttl optional TTL to set for Time-to-Idle eviction.
432-
* @return a future that completes either with a value if the value exists or completing with {@code null} if the
432+
* @return a future that completes either with a value if the value exists or completing with {@literal null} if the
433433
* cache does not contain an entry.
434434
*/
435435
CompletableFuture<byte[]> retrieve(String name, byte[] key, @Nullable Duration ttl);

src/main/java/org/springframework/data/redis/cache/RedisCacheWriter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static TtlFunction persistent() {
293293
* persistent value that does not expire.
294294
*
295295
* @param key the cache key.
296-
* @param value the cache value. Can be {@code null} if the cache supports {@code null} value caching.
296+
* @param value the cache value. Can be {@literal null} if the cache supports {@literal null} value caching.
297297
* @return the computed {@link Duration time-to-live (TTL)}. Can be {@link Duration#ZERO} for persistent values
298298
* (i.e. cache entry does not expire).
299299
*/

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ default Mono<ByteBuffer> hGet(ByteBuffer key, ByteBuffer field) {
289289

290290
/**
291291
* Get values for given {@literal fields} from hash at {@literal key}. Values are in the order of the requested keys.
292-
* Absent field values are represented using {@code null} in the resulting {@link List}.
292+
* Absent field values are represented using {@literal null} in the resulting {@link List}.
293293
*
294294
* @param key must not be {@literal null}.
295295
* @param fields must not be {@literal null}.
@@ -306,7 +306,7 @@ default Mono<List<ByteBuffer>> hMGet(ByteBuffer key, Collection<ByteBuffer> fiel
306306

307307
/**
308308
* Get values for given {@literal fields} from hash at {@literal key}. Values are in the order of the requested keys.
309-
* Absent field values are represented using {@code null} in the resulting {@link List}.
309+
* Absent field values are represented using {@literal null} in the resulting {@link List}.
310310
*
311311
* @param commands must not be {@literal null}.
312312
* @return

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ default Mono<ByteBuffer> getSet(ByteBuffer key, ByteBuffer value) {
350350

351351
/**
352352
* Get multiple values in one batch. Values are in the order of the requested keys. Absent field values are
353-
* represented using {@code null} in the resulting {@link List}.
353+
* represented using {@literal null} in the resulting {@link List}.
354354
*
355355
* @param keys must not be {@literal null}.
356356
* @return
@@ -365,7 +365,7 @@ default Mono<List<ByteBuffer>> mGet(List<ByteBuffer> keys) {
365365

366366
/**
367367
* Get multiple values at for {@literal keysets} in batches. Values are in the order of the requested keys. Absent
368-
* field values are represented using {@code null} in the resulting {@link List}.
368+
* field values are represented using {@literal null} in the resulting {@link List}.
369369
*
370370
* @param keysets must not be {@literal null}.
371371
* @return

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public interface RedisHashCommands {
6969

7070
/**
7171
* Get values for given {@code fields} from hash at {@code key}. Values are in the order of the requested keys Absent
72-
* field values are represented using {@code null} in the resulting {@link List}.
72+
* field values are represented using {@literal null} in the resulting {@link List}.
7373
*
7474
* @param key must not be {@literal null}.
7575
* @param fields must not be {@literal empty}.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ enum BitOperation {
8686

8787
/**
8888
* Get multiple {@code keys}. Values are in the order of the requested keys Absent field values are represented using
89-
* {@code null} in the resulting {@link List}.
89+
* {@literal null} in the resulting {@link List}.
9090
*
9191
* @param keys must not be {@literal null}.
92-
* @return {@code null} when used in pipeline / transaction.
92+
* @return {@literal null} when used in pipeline / transaction.
9393
* @see <a href="https://redis.io/commands/mget">Redis Documentation: MGET</a>
9494
*/
9595
@Nullable

src/main/java/org/springframework/data/redis/connection/lettuce/LettuceFutureUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ static <T> T join(CompletionStage<T> future) throws RuntimeException, Completion
8787

8888
/**
8989
* Returns a {@link Function} that ignores {@link CompletionStage#exceptionally(Function) exceptional completion} by
90-
* recovering to {@code null}. This allows to progress with a previously failed {@link CompletionStage} without regard
91-
* to the actual success/exception state.
90+
* recovering to {@literal null}. This allows to progress with a previously failed {@link CompletionStage} without
91+
* regard to the actual success/exception state.
9292
*
9393
* @return
9494
*/

src/main/java/org/springframework/data/redis/core/BoundHashOperations.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public interface BoundHashOperations<H, HK, HV> extends BoundKeyOperations<H> {
6161

6262
/**
6363
* Get values for given {@code keys} from the hash at the bound key. Values are in the order of the requested keys
64-
* Absent field values are represented using {@code null} in the resulting {@link List}.
64+
* Absent field values are represented using {@literal null} in the resulting {@link List}.
6565
*
6666
* @param keys must not be {@literal null}.
6767
* @return {@literal null} when used in pipeline / transaction.

src/main/java/org/springframework/data/redis/core/HashOperations.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public interface HashOperations<H, HK, HV> {
6161

6262
/**
6363
* Get values for given {@code hashKeys} from hash at {@code key}. Values are in the order of the requested keys
64-
* Absent field values are represented using {@code null} in the resulting {@link List}.
64+
* Absent field values are represented using {@literal null} in the resulting {@link List}.
6565
*
6666
* @param key must not be {@literal null}.
6767
* @param hashKeys must not be {@literal null}.

src/main/java/org/springframework/data/redis/core/ReactiveHashOperations.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
* <p>
2929
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
3030
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
31-
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
32-
* particular element as Reactive Streams prohibit the usage of {@code null} values.
31+
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
32+
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
3333
*
3434
* @author Mark Paluch
3535
* @author Christoph Strobl
@@ -66,7 +66,7 @@ public interface ReactiveHashOperations<H, HK, HV> {
6666

6767
/**
6868
* Get values for given {@code hashKeys} from hash at {@code key}. Values are in the order of the requested keys.
69-
* Absent field values are represented using {@code null} in the resulting {@link List}.
69+
* Absent field values are represented using {@literal null} in the resulting {@link List}.
7070
*
7171
* @param key must not be {@literal null}.
7272
* @param hashKeys must not be {@literal null}.

src/main/java/org/springframework/data/redis/core/ReactiveListOperations.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
* <p>
3434
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
3535
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
36-
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
37-
* particular element as Reactive Streams prohibit the usage of {@code null} values.
36+
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
37+
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
3838
*
3939
* @author Mark Paluch
4040
* @author Christoph Strobl

src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
* <p>
4646
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
4747
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
48-
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
49-
* particular element as Reactive Streams prohibit the usage of {@code null} values.
48+
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
49+
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
5050
*
5151
* @author Mark Paluch
5252
* @author Christoph Strobl

src/main/java/org/springframework/data/redis/core/ReactiveRedisTemplate.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
* <p>
5959
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
6060
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
61-
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
62-
* particular element as Reactive Streams prohibit the usage of {@code null} values.
61+
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
62+
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
6363
*
6464
* @author Mark Paluch
6565
* @author Christoph Strobl

src/main/java/org/springframework/data/redis/core/ReactiveSetOperations.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
* <p>
2828
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
2929
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
30-
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
31-
* particular element as Reactive Streams prohibit the usage of {@code null} values.
30+
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
31+
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
3232
*
3333
* @author Mark Paluch
3434
* @author Christoph Strobl

src/main/java/org/springframework/data/redis/core/ReactiveValueOperations.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
* <p>
3131
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
3232
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
33-
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
34-
* particular element as Reactive Streams prohibit the usage of {@code null} values.
33+
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
34+
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
3535
*
3636
* @author Mark Paluch
3737
* @author Jiahe Cai
@@ -162,7 +162,7 @@ public interface ReactiveValueOperations<K, V> {
162162

163163
/**
164164
* Get multiple {@code keys}. Values are in the order of the requested keys. Absent field values are represented using
165-
* {@code null} in the resulting {@link List}.
165+
* {@literal null} in the resulting {@link List}.
166166
*
167167
* @param keys must not be {@literal null}.
168168
* @see <a href="https://redis.io/commands/mget">Redis Documentation: MGET</a>

src/main/java/org/springframework/data/redis/core/ReactiveZSetOperations.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
* <p>
3838
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
3939
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
40-
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
41-
* particular element as Reactive Streams prohibit the usage of {@code null} values.
40+
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
41+
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
4242
*
4343
* @author Mark Paluch
4444
* @author Christoph Strobl

src/main/java/org/springframework/data/redis/core/RedisCallback.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public interface RedisCallback<T> {
3232
/**
3333
* Method called by {@link RedisTemplate} with an active {@link RedisConnection}.
3434
* <p>
35-
* Callback code need not care about activating/opening or closing the {@link RedisConnection},
36-
* nor handling {@link Exception exceptions}.
35+
* Callback code need not care about activating/opening or closing the {@link RedisConnection}, nor handling
36+
* {@link Exception exceptions}.
3737
*
3838
* @param connection active {@link RedisConnection Redis connection}.
39-
* @return the {@link Object result} of the operation performed in the callback or {@code null}.
39+
* @return the {@link Object result} of the operation performed in the callback or {@literal null}.
4040
* @throws DataAccessException if the operation performed by the callback fails to execute in the context of Redis
41-
* using the given {@link RedisConnection}.
41+
* using the given {@link RedisConnection}.
4242
*/
4343
@Nullable
4444
T doInRedis(RedisConnection connection) throws DataAccessException;

src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ public RedisConnection getRequiredConnection() {
587587
* Override the existing {@link RedisConnection} handle with the given {@link RedisConnection}. Reset the handle if
588588
* given {@literal null}.
589589
* <p>
590-
* Used for releasing the Connection on suspend (with a {@code null} argument) and setting a fresh Connection on
590+
* Used for releasing the Connection on suspend (with a {@literal null} argument) and setting a fresh Connection on
591591
* resume.
592592
*/
593593
protected void setConnection(@Nullable RedisConnection connection) {

src/main/java/org/springframework/data/redis/core/ScanCursor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public ScanCursor(long cursorId) {
7474
* Crates new {@link ScanCursor}
7575
*
7676
* @param cursorId the cursor Id.
77-
* @param options Defaulted to {@link ScanOptions#NONE} if {@code null}.
77+
* @param options Defaulted to {@link ScanOptions#NONE} if {@literal null}.
7878
*/
7979
public ScanCursor(long cursorId, @Nullable ScanOptions options) {
8080

@@ -100,7 +100,7 @@ private void scan(long cursorId) {
100100

101101
/**
102102
* Performs the actual scan command using the native client implementation. The given {@literal options} are never
103-
* {@code null}.
103+
* {@literal null}.
104104
*
105105
* @param cursorId
106106
* @param options

src/main/java/org/springframework/data/redis/core/ValueOperations.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ default Boolean setIfPresent(K key, V value, Duration timeout) {
264264

265265
/**
266266
* Get multiple {@code keys}. Values are in the order of the requested keys Absent field values are represented using
267-
* {@code null} in the resulting {@link List}.
267+
* {@literal null} in the resulting {@link List}.
268268
*
269269
* @param keys must not be {@literal null}.
270270
* @return {@literal null} when used in pipeline / transaction.

src/main/java/org/springframework/data/redis/core/convert/Bucket.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ public byte[] get(String path) {
108108
}
109109

110110
/**
111-
* Return whether {@code path} is associated with a non-{@code null} value.
111+
* Return whether {@code path} is associated with a non-{@literal null} value.
112112
*
113113
* @param path must not be {@literal null} or {@link String#isEmpty()}.
114-
* @return {@literal true} if the {@code path} is associated with a non-{@code null} value.
114+
* @return {@literal true} if the {@code path} is associated with a non-{@literal null} value.
115115
* @since 2.5
116116
*/
117117
public boolean hasValue(String path) {

src/test/java/org/springframework/data/redis/test/condition/RedisConditions.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private RedisConditions(RedisClusterCommands<String, String> commands) {
6565
/**
6666
* Create {@link RedisCommands} given {@link StatefulRedisConnection}.
6767
*
68-
* @param connection must not be {@code null}.
68+
* @param connection must not be {@literal null}.
6969
* @return
7070
*/
7171
public static RedisConditions of(StatefulRedisConnection<String, String> connection) {
@@ -75,7 +75,7 @@ public static RedisConditions of(StatefulRedisConnection<String, String> connect
7575
/**
7676
* Create {@link RedisCommands} given {@link StatefulRedisClusterConnection}.
7777
*
78-
* @param connection must not be {@code null}.
78+
* @param connection must not be {@literal null}.
7979
* @return
8080
*/
8181
public static RedisConditions of(StatefulRedisClusterConnection<String, String> connection) {
@@ -85,7 +85,7 @@ public static RedisConditions of(StatefulRedisClusterConnection<String, String>
8585
/**
8686
* Create {@link RedisConditions} given {@link RedisCommands}.
8787
*
88-
* @param commands must not be {@code null}.
88+
* @param commands must not be {@literal null}.
8989
* @return
9090
*/
9191
public static RedisConditions of(RedisClusterCommands<String, String> commands) {

0 commit comments

Comments
 (0)