diff --git a/src/main/java/org/springframework/data/redis/core/RedisOperations.java b/src/main/java/org/springframework/data/redis/core/RedisOperations.java index d4404435d7..5776c8abfd 100644 --- a/src/main/java/org/springframework/data/redis/core/RedisOperations.java +++ b/src/main/java/org/springframework/data/redis/core/RedisOperations.java @@ -160,17 +160,17 @@ T execute(RedisScript script, RedisSerializer argsSerializer, RedisSer // ------------------------------------------------------------------------- /** - * Copy given {@code sourceKey} to {@code targetKey}. + * Copies the value stored at the {@code source} to the {@code destination}. * - * @param sourceKey must not be {@literal null}. - * @param targetKey must not be {@literal null}. + * @param source must not be {@literal null}. + * @param destination must not be {@literal null}. * @param replace whether the key was copied. {@literal null} when used in pipeline / transaction. * @return * @see Redis Documentation: COPY * @since 2.6 */ @Nullable - Boolean copy(K sourceKey, K targetKey, boolean replace); + Boolean copy(K source, K destination, boolean replace); /** * Determine if given {@code key} exists. @@ -269,24 +269,24 @@ T execute(RedisScript script, RedisSerializer argsSerializer, RedisSer K randomKey(); /** - * Rename key {@code oldKey} to {@code newKey}. + * Rename key {@code key} to {@code newKey}. * - * @param oldKey must not be {@literal null}. + * @param key must not be {@literal null}. * @param newKey must not be {@literal null}. * @see Redis Documentation: RENAME */ - void rename(K oldKey, K newKey); + void rename(K key, K newKey); /** - * Rename key {@code oldKey} to {@code newKey} only if {@code newKey} does not exist. + * Rename {@code key} to {@code newKey} only if {@code newKey} does not exist. * - * @param oldKey must not be {@literal null}. + * @param key must not be {@literal null}. * @param newKey must not be {@literal null}. * @return {@literal null} when used in pipeline / transaction. * @see Redis Documentation: RENAMENX */ @Nullable - Boolean renameIfAbsent(K oldKey, K newKey); + Boolean renameIfAbsent(K key, K newKey); /** * Set time to live for given {@code key}. @@ -355,7 +355,7 @@ default Boolean expireAt(K key, Instant expireAt) { Boolean persist(K key); /** - * Move given {@code key} to database with {@code index}. + * Move given {@code key} to database with {@code dbIndex}. * * @param key must not be {@literal null}. * @param dbIndex @@ -376,7 +376,7 @@ default Boolean expireAt(K key, Instant expireAt) { byte[] dump(K key); /** - * Create {@code key} using the {@code serializedValue}, previously obtained using {@link #dump(Object)}. + * Create {@code key} using the {@code value}, previously obtained using {@link #dump(Object)}. * * @param key must not be {@literal null}. * @param value must not be {@literal null}. @@ -389,7 +389,7 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { } /** - * Create {@code key} using the {@code serializedValue}, previously obtained using {@link #dump(Object)}. + * Create {@code key} using the {@code value}, previously obtained using {@link #dump(Object)}. * * @param key must not be {@literal null}. * @param value must not be {@literal null}. @@ -576,13 +576,13 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { void slaveOfNoOne(); /** - * Publishes the given message to the given channel. + * Publishes the given message to the given {@code channel}. * - * @param destination the channel to publish to, must not be {@literal null}. + * @param channel channel to publish to, must not be {@literal null}. * @param message message to publish * @see Redis Documentation: PUBLISH */ - void convertAndSend(String destination, Object message); + void convertAndSend(String channel, Object message); // ------------------------------------------------------------------------- // Methods to obtain specific operations interface objects. @@ -607,7 +607,7 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { GeoOperations opsForGeo(); /** - * Returns geospatial specific operations interface bound to the given key. + * Returns geospatial specific operations interface bound to the given {@code key}. * * @param key must not be {@literal null}. * @return never {@literal null}. @@ -625,7 +625,7 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { HashOperations opsForHash(); /** - * Returns the operations performed on hash values bound to the given key. + * Returns the operations performed on hash values bound to the given {@code key}. * * @param hash key (or field) type * @param hash value type @@ -648,7 +648,7 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { ListOperations opsForList(); /** - * Returns the operations performed on list values bound to the given key. + * Returns the operations performed on list values bound to the given {@code key}. * * @param key Redis key * @return list operations bound to the given key @@ -663,7 +663,7 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { SetOperations opsForSet(); /** - * Returns the operations performed on set values bound to the given key. + * Returns the operations performed on set values bound to the given {@code key}. * * @param key Redis key * @return set operations bound to the given key @@ -688,7 +688,7 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { StreamOperations opsForStream(HashMapper hashMapper); /** - * Returns the operations performed on Streams bound to the given key. + * Returns the operations performed on Streams bound to the given {@code key}. * * @return stream operations. * @since 2.2 @@ -703,7 +703,7 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { ValueOperations opsForValue(); /** - * Returns the operations performed on simple values (or Strings in Redis terminology) bound to the given key. + * Returns the operations performed on simple values (or Strings in Redis terminology) bound to the given {@code key}. * * @param key Redis key * @return value operations bound to the given key @@ -718,7 +718,7 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { ZSetOperations opsForZSet(); /** - * Returns the operations performed on zset values (also known as sorted sets) bound to the given key. + * Returns the operations performed on zset values (also known as sorted sets) bound to the given {@code key}. * * @param key Redis key * @return zset operations bound to the given key. diff --git a/src/main/java/org/springframework/data/redis/core/RedisTemplate.java b/src/main/java/org/springframework/data/redis/core/RedisTemplate.java index 9075f96933..ee739252e5 100644 --- a/src/main/java/org/springframework/data/redis/core/RedisTemplate.java +++ b/src/main/java/org/springframework/data/redis/core/RedisTemplate.java @@ -83,6 +83,7 @@ * @author Mark Paluch * @author Denis Zavedeev * @author ihaohong + * @author Todd Merrill * @param the Redis key type against which the template works (usually a String) * @param the Redis value type against which the template works * @see StringRedisTemplate @@ -699,15 +700,15 @@ protected List execRaw() { /* * (non-Javadoc) - * @see org.springframework.data.redis.core.RedisOperations#delete(java.lang.Object, java.lang.Object, boolean) + * @see org.springframework.data.redis.core.RedisOperations#copy(java.lang.Object, java.lang.Object, boolean) */ @Override - public Boolean copy(K source, K target, boolean replace) { + public Boolean copy(K source, K destination, boolean replace) { byte[] sourceKey = rawKey(source); - byte[] targetKey = rawKey(target); + byte[] destinationKey = rawKey(destination); - return execute(connection -> connection.copy(sourceKey, targetKey, replace), true); + return execute(connection -> connection.copy(sourceKey, destinationKey, replace), true); } /* @@ -935,9 +936,9 @@ public K randomKey() { * @see org.springframework.data.redis.core.RedisOperations#rename(java.lang.Object, java.lang.Object) */ @Override - public void rename(K oldKey, K newKey) { + public void rename(K key, K newKey) { - byte[] rawOldKey = rawKey(oldKey); + byte[] rawOldKey = rawKey(key); byte[] rawNewKey = rawKey(newKey); execute(connection -> { @@ -951,9 +952,9 @@ public void rename(K oldKey, K newKey) { * @see org.springframework.data.redis.core.RedisOperations#renameIfAbsent(java.lang.Object, java.lang.Object) */ @Override - public Boolean renameIfAbsent(K oldKey, K newKey) { + public Boolean renameIfAbsent(K key, K newKey) { - byte[] rawOldKey = rawKey(oldKey); + byte[] rawOldKey = rawKey(key); byte[] rawNewKey = rawKey(newKey); return execute(connection -> connection.renameNX(rawOldKey, rawNewKey), true); }