diff --git a/src/main/java/redis/clients/jedis/Jedis.java b/src/main/java/redis/clients/jedis/Jedis.java index e57dabc307..5e5385f65c 100644 --- a/src/main/java/redis/clients/jedis/Jedis.java +++ b/src/main/java/redis/clients/jedis/Jedis.java @@ -387,8 +387,11 @@ public String set(final byte[] key, final byte[] value) { * GB). * @param key * @param value - * @param params - * @return OK + * @param params NX|XX, NX -- Only set the key if it does not already exist. XX -- Only set the + * key if it already exists. EX|PX, expire time units: EX = seconds; PX = milliseconds + * @return simple-string-reply {@code OK} if {@code SET} was executed correctly, or {@code null} + * if the {@code SET} operation was not performed because the user specified the NX or XX option + * but the condition was not met. */ @Override public String set(final byte[] key, final byte[] value, final SetParams params) { @@ -4884,7 +4887,9 @@ public String set(final String key, final String value) { * @param value * @param params NX|XX, NX -- Only set the key if it does not already exist. XX -- Only set the * key if it already exists. EX|PX, expire time units: EX = seconds; PX = milliseconds - * @return OK + * @return simple-string-reply {@code OK} if {@code SET} was executed correctly, or {@code null} + * if the {@code SET} operation was not performed because the user specified the NX or XX option + * but the condition was not met. */ @Override public String set(final String key, final String value, final SetParams params) { diff --git a/src/main/java/redis/clients/jedis/commands/StringCommands.java b/src/main/java/redis/clients/jedis/commands/StringCommands.java index 6be8c31d99..9fd912a151 100644 --- a/src/main/java/redis/clients/jedis/commands/StringCommands.java +++ b/src/main/java/redis/clients/jedis/commands/StringCommands.java @@ -32,7 +32,9 @@ public interface StringCommands { * @param key * @param value * @param params {@link SetParams} - * @return OK + * @return simple-string-reply {@code OK} if {@code SET} was executed correctly, or {@code null} + * if the {@code SET} operation was not performed because the user specified the NX or XX option + * but the condition was not met. */ String set(String key, String value, SetParams params);