Polishing.

Consistently use literal null.

See #3010
This commit is contained in:
Mark Paluch
2024-10-10 14:34:21 +02:00
parent 8fe72a0840
commit d47d3e800d
22 changed files with 42 additions and 42 deletions

View File

@@ -427,7 +427,7 @@ class DefaultRedisCacheWriter implements RedisCacheWriter {
* @param name the cache name from which to retrieve the cache entry.
* @param key the cache entry key.
* @param ttl optional TTL to set for Time-to-Idle eviction.
* @return a future that completes either with a value if the value exists or completing with {@code null} if the
* @return a future that completes either with a value if the value exists or completing with {@literal null} if the
* cache does not contain an entry.
*/
CompletableFuture<byte[]> retrieve(String name, byte[] key, @Nullable Duration ttl);

View File

@@ -293,7 +293,7 @@ public interface RedisCacheWriter extends CacheStatisticsProvider {
* persistent value that does not expire.
*
* @param key the cache key.
* @param value the cache value. Can be {@code null} if the cache supports {@code null} value caching.
* @param value the cache value. Can be {@literal null} if the cache supports {@literal null} value caching.
* @return the computed {@link Duration time-to-live (TTL)}. Can be {@link Duration#ZERO} for persistent values
* (i.e. cache entry does not expire).
*/

View File

@@ -289,7 +289,7 @@ public interface ReactiveHashCommands {
/**
* Get values for given {@literal fields} from hash at {@literal key}. Values are in the order of the requested keys.
* Absent field values are represented using {@code null} in the resulting {@link List}.
* Absent field values are represented using {@literal null} in the resulting {@link List}.
*
* @param key must not be {@literal null}.
* @param fields must not be {@literal null}.
@@ -306,7 +306,7 @@ public interface ReactiveHashCommands {
/**
* Get values for given {@literal fields} from hash at {@literal key}. Values are in the order of the requested keys.
* Absent field values are represented using {@code null} in the resulting {@link List}.
* Absent field values are represented using {@literal null} in the resulting {@link List}.
*
* @param commands must not be {@literal null}.
* @return

View File

@@ -350,7 +350,7 @@ public interface ReactiveStringCommands {
/**
* Get multiple values in one batch. Values are in the order of the requested keys. Absent field values are
* represented using {@code null} in the resulting {@link List}.
* represented using {@literal null} in the resulting {@link List}.
*
* @param keys must not be {@literal null}.
* @return
@@ -365,7 +365,7 @@ public interface ReactiveStringCommands {
/**
* Get multiple values at for {@literal keysets} in batches. Values are in the order of the requested keys. Absent
* field values are represented using {@code null} in the resulting {@link List}.
* field values are represented using {@literal null} in the resulting {@link List}.
*
* @param keysets must not be {@literal null}.
* @return

View File

@@ -69,7 +69,7 @@ public interface RedisHashCommands {
/**
* Get values for given {@code fields} from hash at {@code key}. Values are in the order of the requested keys Absent
* field values are represented using {@code null} in the resulting {@link List}.
* field values are represented using {@literal null} in the resulting {@link List}.
*
* @param key must not be {@literal null}.
* @param fields must not be {@literal empty}.

View File

@@ -86,10 +86,10 @@ public interface RedisStringCommands {
/**
* Get multiple {@code keys}. Values are in the order of the requested keys Absent field values are represented using
* {@code null} in the resulting {@link List}.
* {@literal null} in the resulting {@link List}.
*
* @param keys must not be {@literal null}.
* @return {@code null} when used in pipeline / transaction.
* @return {@literal null} when used in pipeline / transaction.
* @see <a href="https://redis.io/commands/mget">Redis Documentation: MGET</a>
*/
@Nullable

View File

@@ -87,8 +87,8 @@ class LettuceFutureUtils {
/**
* Returns a {@link Function} that ignores {@link CompletionStage#exceptionally(Function) exceptional completion} by
* recovering to {@code null}. This allows to progress with a previously failed {@link CompletionStage} without regard
* to the actual success/exception state.
* recovering to {@literal null}. This allows to progress with a previously failed {@link CompletionStage} without
* regard to the actual success/exception state.
*
* @return
*/

View File

@@ -61,7 +61,7 @@ public interface BoundHashOperations<H, HK, HV> extends BoundKeyOperations<H> {
/**
* Get values for given {@code keys} from the hash at the bound key. Values are in the order of the requested keys
* Absent field values are represented using {@code null} in the resulting {@link List}.
* Absent field values are represented using {@literal null} in the resulting {@link List}.
*
* @param keys must not be {@literal null}.
* @return {@literal null} when used in pipeline / transaction.

View File

@@ -61,7 +61,7 @@ public interface HashOperations<H, HK, HV> {
/**
* Get values for given {@code hashKeys} from hash at {@code key}. Values are in the order of the requested keys
* Absent field values are represented using {@code null} in the resulting {@link List}.
* Absent field values are represented using {@literal null} in the resulting {@link List}.
*
* @param key must not be {@literal null}.
* @param hashKeys must not be {@literal null}.

View File

@@ -28,8 +28,8 @@ import java.util.Map;
* <p>
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
* particular element as Reactive Streams prohibit the usage of {@code null} values.
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
*
* @author Mark Paluch
* @author Christoph Strobl
@@ -66,7 +66,7 @@ public interface ReactiveHashOperations<H, HK, HV> {
/**
* Get values for given {@code hashKeys} from hash at {@code key}. Values are in the order of the requested keys.
* Absent field values are represented using {@code null} in the resulting {@link List}.
* Absent field values are represented using {@literal null} in the resulting {@link List}.
*
* @param key must not be {@literal null}.
* @param hashKeys must not be {@literal null}.

View File

@@ -33,8 +33,8 @@ import org.springframework.util.Assert;
* <p>
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
* particular element as Reactive Streams prohibit the usage of {@code null} values.
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
*
* @author Mark Paluch
* @author Christoph Strobl

View File

@@ -45,8 +45,8 @@ import org.springframework.util.Assert;
* <p>
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
* particular element as Reactive Streams prohibit the usage of {@code null} values.
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
*
* @author Mark Paluch
* @author Christoph Strobl

View File

@@ -58,8 +58,8 @@ import org.springframework.util.ClassUtils;
* <p>
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
* particular element as Reactive Streams prohibit the usage of {@code null} values.
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
*
* @author Mark Paluch
* @author Christoph Strobl

View File

@@ -27,8 +27,8 @@ import java.util.Map;
* <p>
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
* particular element as Reactive Streams prohibit the usage of {@code null} values.
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
*
* @author Mark Paluch
* @author Christoph Strobl

View File

@@ -30,8 +30,8 @@ import org.springframework.data.redis.connection.BitFieldSubCommands;
* <p>
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
* particular element as Reactive Streams prohibit the usage of {@code null} values.
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
*
* @author Mark Paluch
* @author Jiahe Cai
@@ -162,7 +162,7 @@ public interface ReactiveValueOperations<K, V> {
/**
* Get multiple {@code keys}. Values are in the order of the requested keys. Absent field values are represented using
* {@code null} in the resulting {@link List}.
* {@literal null} in the resulting {@link List}.
*
* @param keys must not be {@literal null}.
* @see <a href="https://redis.io/commands/mget">Redis Documentation: MGET</a>

View File

@@ -37,8 +37,8 @@ import org.springframework.lang.Nullable;
* <p>
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
* particular element as Reactive Streams prohibit the usage of {@code null} values.
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
*
* @author Mark Paluch
* @author Christoph Strobl

View File

@@ -32,13 +32,13 @@ public interface RedisCallback<T> {
/**
* Method called by {@link RedisTemplate} with an active {@link RedisConnection}.
* <p>
* Callback code need not care about activating/opening or closing the {@link RedisConnection},
* nor handling {@link Exception exceptions}.
* Callback code need not care about activating/opening or closing the {@link RedisConnection}, nor handling
* {@link Exception exceptions}.
*
* @param connection active {@link RedisConnection Redis connection}.
* @return the {@link Object result} of the operation performed in the callback or {@code null}.
* @return the {@link Object result} of the operation performed in the callback or {@literal null}.
* @throws DataAccessException if the operation performed by the callback fails to execute in the context of Redis
* using the given {@link RedisConnection}.
* using the given {@link RedisConnection}.
*/
@Nullable
T doInRedis(RedisConnection connection) throws DataAccessException;

View File

@@ -587,7 +587,7 @@ public abstract class RedisConnectionUtils {
* Override the existing {@link RedisConnection} handle with the given {@link RedisConnection}. Reset the handle if
* given {@literal null}.
* <p>
* Used for releasing the Connection on suspend (with a {@code null} argument) and setting a fresh Connection on
* Used for releasing the Connection on suspend (with a {@literal null} argument) and setting a fresh Connection on
* resume.
*/
protected void setConnection(@Nullable RedisConnection connection) {

View File

@@ -86,7 +86,7 @@ public abstract class ScanCursor<T> implements Cursor<T> {
* Crates new {@link ScanCursor}
*
* @param cursorId the cursor Id.
* @param options Defaulted to {@link ScanOptions#NONE} if {@code null}.
* @param options Defaulted to {@link ScanOptions#NONE} if {@literal null}.
* @deprecated since 3.3.0 - Use {@link ScanCursor#ScanCursor(CursorId, ScanOptions)} instead.
*/
@Deprecated(since = "3.3.0")
@@ -125,7 +125,7 @@ public abstract class ScanCursor<T> implements Cursor<T> {
/**
* Performs the actual scan command using the native client implementation. The given {@literal options} are never
* {@code null}.
* {@literal null}.
*
* @param cursorId
* @param options

View File

@@ -264,7 +264,7 @@ public interface ValueOperations<K, V> {
/**
* Get multiple {@code keys}. Values are in the order of the requested keys Absent field values are represented using
* {@code null} in the resulting {@link List}.
* {@literal null} in the resulting {@link List}.
*
* @param keys must not be {@literal null}.
* @return {@literal null} when used in pipeline / transaction.

View File

@@ -108,10 +108,10 @@ public class Bucket {
}
/**
* Return whether {@code path} is associated with a non-{@code null} value.
* Return whether {@code path} is associated with a non-{@literal null} value.
*
* @param path must not be {@literal null} or {@link String#isEmpty()}.
* @return {@literal true} if the {@code path} is associated with a non-{@code null} value.
* @return {@literal true} if the {@code path} is associated with a non-{@literal null} value.
* @since 2.5
*/
public boolean hasValue(String path) {

View File

@@ -65,7 +65,7 @@ class RedisConditions {
/**
* Create {@link RedisCommands} given {@link StatefulRedisConnection}.
*
* @param connection must not be {@code null}.
* @param connection must not be {@literal null}.
* @return
*/
public static RedisConditions of(StatefulRedisConnection<String, String> connection) {
@@ -75,7 +75,7 @@ class RedisConditions {
/**
* Create {@link RedisCommands} given {@link StatefulRedisClusterConnection}.
*
* @param connection must not be {@code null}.
* @param connection must not be {@literal null}.
* @return
*/
public static RedisConditions of(StatefulRedisClusterConnection<String, String> connection) {
@@ -85,7 +85,7 @@ class RedisConditions {
/**
* Create {@link RedisConditions} given {@link RedisCommands}.
*
* @param commands must not be {@code null}.
* @param commands must not be {@literal null}.
* @return
*/
public static RedisConditions of(RedisClusterCommands<String, String> commands) {