-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent key names in COPY / RENAME / RENAMEX / PUBLISH command documentation and other fixes. #2196
base: 2.7.x
Are you sure you want to change the base?
Inconsistent key names in COPY / RENAME / RENAMEX / PUBLISH command documentation and other fixes. #2196
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,17 +160,17 @@ <T> T execute(RedisScript<T> 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 <a href="https://redis.io/commands/copy">Redis Documentation: COPY</a> | ||
* @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> T execute(RedisScript<T> 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 <a href="https://redis.io/commands/rename">Redis Documentation: RENAME</a> | ||
*/ | ||
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 <a href="https://redis.io/commands/renamenx">Redis Documentation: RENAMENX</a> | ||
*/ | ||
@Nullable | ||
Boolean renameIfAbsent(K oldKey, K newKey); | ||
Boolean renameIfAbsent(K key, K newKey); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the renames are fine here. But, I think the Javadoc needs serious work. For example, what does the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not our responsibility to educate folks about the concepts of their data store. |
||
|
||
/** | ||
* 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 <a href="https://redis.io/commands/publish">Redis Documentation: PUBLISH</a> | ||
*/ | ||
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<K, V> 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) { | |
<HK, HV> HashOperations<K, HK, HV> 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 <HK> hash key (or field) type | ||
* @param <HV> hash value type | ||
|
@@ -648,7 +648,7 @@ default void restore(K key, byte[] value, long timeToLive, TimeUnit unit) { | |
ListOperations<K, V> 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<K, V> 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) { | |
<HK, HV> StreamOperations<K, HK, HV> opsForStream(HashMapper<? super K, ? super HK, ? super HV> 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<K, V> 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<K, V> 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. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, neither
source
nordestination
describe what they are. For instance, are they keys, are they values, what?"
must not be {@literal null}
" is not informative and arguably no longer needed given the package-level@NonNullApi
requires non-null
values when method parameters are not explicitly annotated with@Nullable
.I am fine with shorter names as long as the Javadoc makes it apparent what things are and what they are used for.