Skip to content

Commit

Permalink
Fixed documentation for decr and added @nonnull tags where appropriate.
Browse files Browse the repository at this point in the history
  • Loading branch information
SanHalacogluImproving committed Feb 12, 2024
1 parent bc6e662 commit 8f58dd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions java/client/src/main/java/glide/api/BaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ public CompletableFuture<String> set(
}

@Override
public CompletableFuture<Long> decr(String key) {
public CompletableFuture<Long> decr(@NonNull String key) {
return commandManager.submitNewCommand(Decr, new String[] {key}, this::handleLongResponse);
}

@Override
public CompletableFuture<Long> decrBy(String key, long amount) {
public CompletableFuture<Long> decrBy(@NonNull String key, long amount) {
return commandManager.submitNewCommand(
DecrBy, new String[] {key, Long.toString(amount)}, this::handleLongResponse);
}
Expand Down
14 changes: 6 additions & 8 deletions java/client/src/main/java/glide/api/commands/StringCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ public interface StringCommands {
CompletableFuture<String> set(String key, String value, SetOptions options);

/**
* Increment the string representing a floating point number stored at <code>key</code> by <code>
* amount</code>. By using a negative increment value, the result is that the value stored at
* <code>key</code> is decremented. If <code>key</code> does not exist, it is set to 0 before
* performing the operation.
* Decrements the number stored at <code>key</code> by one. If <code>key</code> does not exist, it
* is set to 0 before performing the operation.
*
* @see <a href="https://redis.io/commands/decr/">redis.io</a> for details.
* @param key The key to increment its value.
* @return The value of <code>key</code> after the increment. An error is raised if <code>key
* </code> contains a value of the wrong type, or the current <code>key</code> content is not
* parsable as a double precision floating point number.
* @param key The key to decrement its value.
* @return The value of <code>key</code> after the decrement. An error is raised if <code>key
* </code> contains a value of the wrong type or contains a string that cannot be represented
* as integer.
*/
CompletableFuture<Long> decr(String key);

Expand Down

0 comments on commit 8f58dd4

Please sign in to comment.