diff --git a/java/client/src/main/java/glide/api/BaseClient.java b/java/client/src/main/java/glide/api/BaseClient.java index 2ddf4acfc0..bff0f2b29d 100644 --- a/java/client/src/main/java/glide/api/BaseClient.java +++ b/java/client/src/main/java/glide/api/BaseClient.java @@ -181,12 +181,12 @@ public CompletableFuture set( } @Override - public CompletableFuture decr(String key) { + public CompletableFuture decr(@NonNull String key) { return commandManager.submitNewCommand(Decr, new String[] {key}, this::handleLongResponse); } @Override - public CompletableFuture decrBy(String key, long amount) { + public CompletableFuture decrBy(@NonNull String key, long amount) { return commandManager.submitNewCommand( DecrBy, new String[] {key, Long.toString(amount)}, this::handleLongResponse); } diff --git a/java/client/src/main/java/glide/api/commands/StringCommands.java b/java/client/src/main/java/glide/api/commands/StringCommands.java index f3855c24eb..b9eb07eda2 100644 --- a/java/client/src/main/java/glide/api/commands/StringCommands.java +++ b/java/client/src/main/java/glide/api/commands/StringCommands.java @@ -50,16 +50,14 @@ public interface StringCommands { CompletableFuture set(String key, String value, SetOptions options); /** - * Increment the string representing a floating point number stored at key by - * amount. By using a negative increment value, the result is that the value stored at - * key is decremented. If key does not exist, it is set to 0 before - * performing the operation. + * Decrements the number stored at key by one. If key does not exist, it + * is set to 0 before performing the operation. * * @see redis.io for details. - * @param key The key to increment its value. - * @return The value of key after the increment. An error is raised if key - * contains a value of the wrong type, or the current key content is not - * parsable as a double precision floating point number. + * @param key The key to decrement its value. + * @return The value of key after the decrement. An error is raised if key + * contains a value of the wrong type or contains a string that cannot be represented + * as integer. */ CompletableFuture decr(String key);