Skip to content

Commit 1eaa60a

Browse files
fix #12, Add doc for nil (#14)
Signed-off-by: bodong.ybd <[email protected]>
1 parent b32fc05 commit 1eaa60a

File tree

8 files changed

+73
-73
lines changed

8 files changed

+73
-73
lines changed

src/main/java/io/valkey/Jedis.java

Lines changed: 48 additions & 48 deletions
Large diffs are not rendered by default.

src/main/java/io/valkey/commands/ControlBinaryCommands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public interface ControlBinaryCommands extends AccessControlLogBinaryCommands, C
7777
* See for details: <a href="https://redis.io/commands/memory-usage">MEMORY USAGE key</a>
7878
*
7979
* @param key The key in Redis server
80-
* @return The memory usage in bytes, or nil when the key does not exist
80+
* @return The memory usage in bytes, or nil(Java's null) when the key does not exist
8181
*/
8282
Long memoryUsage(byte[] key);
8383

@@ -89,7 +89,7 @@ public interface ControlBinaryCommands extends AccessControlLogBinaryCommands, C
8989
* See for details: <a href="https://redis.io/commands/memory-usage">MEMORY USAGE key SAMPLES count</a>
9090
*
9191
* @param key The key in Redis server
92-
* @return The memory usage in bytes, or nil when the key does not exist
92+
* @return The memory usage in bytes, or nil(Java's null) when the key does not exist
9393
*/
9494
Long memoryUsage(byte[] key, int samples);
9595

src/main/java/io/valkey/commands/ControlCommands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public interface ControlCommands extends AccessControlLogCommands, ClientCommand
7878
* See for details: <a href="https://redis.io/commands/memory-usage">MEMORY USAGE key</a>
7979
*
8080
* @param key The key in Redis server
81-
* @return The memory usage in bytes, or {@code nil} when the key does not exist
81+
* @return The memory usage in bytes, or {@code nil(Java's null)} when the key does not exist
8282
*/
8383
Long memoryUsage(String key);
8484

@@ -90,7 +90,7 @@ public interface ControlCommands extends AccessControlLogCommands, ClientCommand
9090
* See for details: <a href="https://redis.io/commands/memory-usage">MEMORY USAGE key SAMPLES count</a>
9191
*
9292
* @param key The key in Redis server
93-
* @return The memory usage in bytes, or {@code nil} when the key does not exist
93+
* @return The memory usage in bytes, or {@code nil(Java's null)} when the key does not exist
9494
*/
9595
Long memoryUsage(String key, int samples);
9696

src/main/java/io/valkey/commands/KeyCommands.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ public interface KeyCommands {
608608
* Return a randomly selected key from the currently selected DB.
609609
* <p>
610610
* Time complexity: O(1)
611-
* @return The random key, or {@code nil} when the database is empty
611+
* @return The random key, or {@code nil(Java's null)} when the database is empty
612612
*/
613613
String randomKey();
614614

src/main/java/io/valkey/commands/ListCommands.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public interface ListCommands {
116116
* and so on.
117117
* <p>
118118
* If the value stored at key is not of list type an error is returned. If the index is out of
119-
* range a 'nil' reply is returned.
119+
* range a 'nil(Java's null)' reply is returned.
120120
* <p>
121121
* Note that even if the average time complexity is O(n) asking for the first or the last element
122122
* of the list is O(1).
@@ -168,7 +168,7 @@ public interface ListCommands {
168168
* if the list contains the elements "a","b","c" LPOP will return "a" and the list will become
169169
* "b","c".
170170
* <p>
171-
* If the key does not exist or the list is already empty the special value 'nil' is returned.
171+
* If the key does not exist or the list is already empty the special value 'nil(Java's null)' is returned.
172172
* @param key
173173
* @return The popped element
174174
*/
@@ -180,19 +180,19 @@ public interface ListCommands {
180180
* "b","c".
181181
* @param key
182182
* @param count
183-
* @return A list of popped elements, or 'nil' when key does not exist
183+
* @return A list of popped elements, or 'nil(Java's null)' when key does not exist
184184
*/
185185
List<String> lpop(String key, int count);
186186

187187
/**
188188
* Returns the index of the first matching element inside a redis list. If the element is found,
189189
* its index (the zero-based position in the list) is returned. Otherwise, if no match is found,
190-
* 'nil' is returned.
190+
* 'nil(Java's null)' is returned.
191191
* <p>
192192
* Time complexity: O(N) where N is the number of elements in the list
193193
* @param key
194194
* @param element
195-
* @return The index of first matching element in the list. Value will be 'nil' when the element
195+
* @return The index of first matching element in the list. Value will be 'nil(Java's null)' when the element
196196
* is not present in the list
197197
*/
198198
Long lpos(String key, String element);
@@ -211,13 +211,13 @@ public interface ListCommands {
211211
* @param key
212212
* @param element
213213
* @param params {@link LPosParams}
214-
* @return The integer representing the matching element, or 'nil' if there is no match
214+
* @return The integer representing the matching element, or 'nil(Java's null)' if there is no match
215215
*/
216216
Long lpos(String key, String element, LPosParams params);
217217

218218
/**
219219
* Returns the index of matching elements inside a Redis list. If the element is found, its index
220-
* (the zero-based position in the list) is returned. Otherwise, if no match is found, nil is returned.
220+
* (the zero-based position in the list) is returned. Otherwise, if no match is found, nil(Java's null) is returned.
221221
* <p>
222222
* Time complexity: O(N) where N is the number of elements in the list
223223
* @param key
@@ -243,7 +243,7 @@ public interface ListCommands {
243243
* "b","c".
244244
* @param key
245245
* @param count return up to count elements
246-
* @return A list of count popped elements, or 'nil' when key does not exist.
246+
* @return A list of count popped elements, or 'nil(Java's null)' when key does not exist.
247247
*/
248248
List<String> rpop(String key, int count);
249249

@@ -346,7 +346,7 @@ public interface ListCommands {
346346
* elements "a","b","c" and the destination list contains the elements "foo","bar" after an
347347
* RPOPLPUSH command the content of the two lists will be "a","b" and "c","foo","bar".
348348
* <p>
349-
* If the key does not exist or the list is already empty the special value 'nil' is returned. If
349+
* If the key does not exist or the list is already empty the special value 'nil(Java's null)' is returned. If
350350
* the srckey and dstkey are the same the operation is equivalent to removing the last element
351351
* from the list and pushing it as first element of the list, so it's a "list rotation" command.
352352
* <p>

src/main/java/io/valkey/commands/SetCommands.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ public interface SetCommands {
4444

4545
/**
4646
* Remove a random element from a Set returning it as return value. If the Set is empty or the key
47-
* does not exist, a nil object is returned.
47+
* does not exist, a nil(Java's null) object is returned.
4848
* <p>
4949
* The {@link SetCommands#srandmember(String)} command does a similar work but the returned element is
5050
* not removed from the Set.
5151
* <p>
5252
* Time complexity O(1)
5353
* @param key
54-
* @return The removed member, or nil when key does not exist
54+
* @return The removed member, or nil(Java's null) when key does not exist
5555
*/
5656
String spop(String key);
5757

@@ -99,7 +99,7 @@ public interface SetCommands {
9999

100100
/**
101101
* Return a random element from a Set, without removing the element. If the Set is empty or the
102-
* key does not exist, a nil object is returned.
102+
* key does not exist, a nil(Java's null) object is returned.
103103
* <p>
104104
* The {@link SetCommands#spop(String) SPOP} command does a similar work but the returned element
105105
* is popped (removed) from the Set.

src/main/java/io/valkey/commands/SortedSetCommands.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ public interface SortedSetCommands {
129129
* Return the rank (or index) of member in the sorted set at key, with scores being ordered from
130130
* low to high.
131131
* <p>
132-
* When the given member does not exist in the sorted set, the special value 'nil' is returned.
132+
* When the given member does not exist in the sorted set, the special value 'nil(Java's null)' is returned.
133133
* The returned rank (or index) of the member is 0-based for both commands.
134134
* <p>
135135
* Time complexity O(log(N))
136136
* @param key
137137
* @param member
138-
* @return The rank of the element as an integer reply if the element exists. A nil bulk reply
138+
* @return The rank of the element as an integer reply if the element exists. A nil(Java's null) bulk reply
139139
* if there is no such element
140140
*/
141141
Long zrank(String key, String member);
@@ -144,13 +144,13 @@ public interface SortedSetCommands {
144144
* Return the rank (or index) of member in the sorted set at key, with scores being ordered from
145145
* high to low.
146146
* <p>
147-
* When the given member does not exist in the sorted set, the special value 'nil' is returned.
147+
* When the given member does not exist in the sorted set, the special value 'nil(Java's null)' is returned.
148148
* The returned rank (or index) of the member is 0-based for both commands.
149149
* <p>
150150
* Time complexity O(log(N))
151151
* @param key
152152
* @param member
153-
* @return The rank of the element as an integer reply if the element exists. A nil bulk reply
153+
* @return The rank of the element as an integer reply if the element exists. A nil(Java's null) bulk reply
154154
* if there is no such element
155155
*/
156156
Long zrevrank(String key, String member);
@@ -289,7 +289,7 @@ public interface SortedSetCommands {
289289

290290
/**
291291
* Return the score of the specified element of the sorted set at key. If the specified element
292-
* does not exist in the sorted set, or the key does not exist at all, a special 'nil' value is
292+
* does not exist in the sorted set, or the key does not exist at all, a special 'nil(Java's null)' value is
293293
* returned.
294294
* <p>
295295
* Time complexity O(1)
@@ -301,7 +301,7 @@ public interface SortedSetCommands {
301301

302302
/**
303303
* Return the scores associated with the specified members in the sorted set stored at key.
304-
* For every member that does not exist in the sorted set, a nil value is returned.
304+
* For every member that does not exist in the sorted set, a nil(Java's null) value is returned.
305305
* <p>
306306
* Time complexity O(N) where N is the number of members being requested
307307
* @param key

src/main/java/io/valkey/commands/StringCommands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public interface StringCommands extends BitCommands {
3636

3737
/**
3838
* <b><a href="http://redis.io/commands/get">Get Command</a></b>
39-
* Get the value of the specified key. If the key does not exist the special value 'nil' is
39+
* Get the value of the specified key. If the key does not exist the special value 'nil(Java's null)' is
4040
* returned. If the value stored at key is not a string an error is returned because GET can only
4141
* handle string values.
4242
* <p>
@@ -163,7 +163,7 @@ public interface StringCommands extends BitCommands {
163163
/**
164164
* <b><a href="http://redis.io/commands/mget">MGet Command</a></b>
165165
* Get the values of all the specified keys. If one or more keys don't exist or is not of type
166-
* String, a 'nil' value is returned instead of the value of the specified key, but the operation
166+
* String, a 'nil(Java's null)' value is returned instead of the value of the specified key, but the operation
167167
* never fails.
168168
* <p>
169169
* Time complexity: O(1) for every key

0 commit comments

Comments
 (0)