Skip to content

Commit

Permalink
Move javadoc fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Mar 25, 2024
1 parent e27012f commit d5206c2
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ CompletableFuture<Boolean> pexpireAt(
* if <code>key</code> exists but has no associated expire.
* @example
* <pre>{@code
* Long timeRemaining = client.ttl("my_key").get()
* assert timeRemaining == 3600L //Indicates that "my_key" has a remaining time to live of 3600 seconds.
* Long timeRemaining = client.ttl("my_key").get();
* assert timeRemaining == 3600L; //Indicates that "my_key" has a remaining time to live of 3600 seconds.
*
* Long timeRemaining = client.ttl("nonexistent_key").get();
* assert timeRemaining == -2L; //Returns -2 for a non-existing key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface GenericCommands {
* this function.
* @example
* <pre>{@code
* Object response = (String) client.customCommand(new String[] {"ping", "GLIDE"}).get()
* Object response = (String) client.customCommand(new String[] {"ping", "GLIDE"}).get();
* assert ((String) response).equals("GLIDE");
* // Get a list of all pub/sub clients:
* Object result = client.customCommand(new String[]{ "CLIENT", "LIST", "TYPE", "PUBSUB" }).get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public interface HashBaseCommands {
* If <code>key</code> does not exist, it is treated as an empty hash and it returns 0.<br>
* @example
* <pre>{@code
* Long num = client.hdel("my_hash", new String[] {}).get("field1", "field2");
* Long num = client.hdel("my_hash", new String[] {"field1", "field2"}).get();
* assert num == 2L; //Indicates that two fields were successfully removed from the hash.
* }</pre>
*/
Expand Down
20 changes: 10 additions & 10 deletions java/client/src/main/java/glide/api/commands/ListBaseCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ public interface ListBaseCommands {
* If <code>key</code> does not exist an empty array will be returned.
* @example
* <pre>{@code
* String[] payload = lient.lrange("my_list", 0, 2).get()
* assert payload.equals(new String[] {"value1", "value2", "value3"})
* String[] payload = lient.lrange("my_list", 0, 2).get();
* assert payload.equals(new String[] {"value1", "value2", "value3"});
*
* String[] payload = client.lrange("my_list", -2, -1).get()
* assert payload.equals(new String[] {"value2", "value3"})
* String[] payload = client.lrange("my_list", -2, -1).get();
* assert payload.equals(new String[] {"value2", "value3"});
*
* String[] payload = client.lrange("non_exiting_key", 0, 2).get()
* assert payload.equals(new String[] {})
* String[] payload = client.lrange("non_exiting_key", 0, 2).get();
* assert payload.equals(new String[] {});
* }</pre>
*/
CompletableFuture<String[]> lrange(String key, long start, long end);
Expand Down Expand Up @@ -181,11 +181,11 @@ public interface ListBaseCommands {
* @return The length of the list after the push operations.
* @example
* <pre>{@code
* Long pushCount1 = client.rpush("my_list", new String[] {"value1", "value2"}).get()
* assert pushCount1 == 2L
* Long pushCount1 = client.rpush("my_list", new String[] {"value1", "value2"}).get();
* assert pushCount1 == 2L;
*
* Long pushCount2 = client.rpush("nonexistent_list", new String[] {"new_value"}).get()
* assert pushCount2 == 1L
* Long pushCount2 = client.rpush("nonexistent_list", new String[] {"new_value"}).get();
* assert pushCount2 == 1L;
* }</pre>
*/
CompletableFuture<Long> rpush(String key, String[] elements);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ public interface SortedSetBaseCommands {
* If <code>changed</code> is set, returns the number of elements updated in the sorted set.
* @example
* <pre>{@code
* Long num = client.zadd("mySortedSet", Map.of("member1", 10.5, "member2", 8.2), ZaddOptions.builder().build(), false).get();
* ZaddOptions options = ZaddOptions.builder().build();
* Long num = client.zadd("mySortedSet", Map.of("member1", 10.5, "member2", 8.2), options, false).get();
* assert num == 2L; // Indicates that two elements have been added or updated in the sorted set "mySortedSet".
*
* Long num = client.zadd("existingSortedSet", Map.of("member1", 15.0, "member2", 5.5), ZaddOptions.builder().conditionalChange(ZaddOptions.ConditionalChange.ONLY_IF_EXISTS).build(), false).get();
* options = ZaddOptions.builder().conditionalChange(ONLY_IF_EXISTS).build();
* Long num = client.zadd("existingSortedSet", Map.of("member1", 15.0, "member2", 5.5), options, false).get();
* assert num == 2L; // Updates the scores of two existing members in the sorted set "existingSortedSet".
* }</pre>
*/
Expand All @@ -48,10 +50,12 @@ CompletableFuture<Long> zadd(
* @return The number of elements added to the sorted set.
* @example
* <pre>{@code
* Long num = client.zadd("mySortedSet", Map.of("member1", 10.5, "member2", 8.2), ZaddOptions.builder().build()).get();
* ZaddOptions options = ZaddOptions.builder().build();
* Long num = client.zadd("mySortedSet", Map.of("member1", 10.5, "member2", 8.2), options).get();
* assert num == 2L; // Indicates that two elements have been added to the sorted set "mySortedSet".
*
* Long num = client.zadd("existingSortedSet", Map.of("member1", 15.0, "member2", 5.5), ZaddOptions.builder().conditionalChange(ZaddOptions.ConditionalChange.ONLY_IF_EXISTS).build()).get();
* options = ZaddOptions.builder().conditionalChange(ONLY_IF_EXISTS).build();
* Long num = client.zadd("existingSortedSet", Map.of("member1", 15.0, "member2", 5.5), options).get();
* assert num == 0L; // No new members were added to the sorted set "existingSortedSet".
* }</pre>
*/
Expand Down Expand Up @@ -111,10 +115,12 @@ CompletableFuture<Long> zadd(
* returned.
* @example
* <pre>{@code
* Double num = client.zaddIncr("mySortedSet", member, 5.0, ZaddOptions.builder().build()).get();
* ZaddOptions options = ZaddOptions.builder().build();
* Double num = client.zaddIncr("mySortedSet", member, 5.0, ).get();
* assert num == 5.0;
*
* Double num = client.zaddIncr("existingSortedSet", member, 3.0, ZaddOptions.builder().updateOptions(ZaddOptions.UpdateOptions.SCORE_LESS_THAN_CURRENT).build()).get();
* options = ZaddOptions.builder().updateOptions(SCORE_LESS_THAN_CURRENT).build();
* Double num = client.zaddIncr("existingSortedSet", member, 3.0, options).get();
* assert num == null;
* }</pre>
*/
Expand Down
32 changes: 14 additions & 18 deletions java/client/src/main/java/glide/api/commands/StringCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public interface StringCommands {
* <code>key</code> as a <code>String</code>. Otherwise, return <code>null</code>.
* @example
* <pre>{@code
* String payload = client.get("key").get();
* assert payload.equals("value");
* String value = client.get("key").get();
* assert value.equals("value");
*
* String payload = client.get("non_existing_key").get();
* assert payload.equals(null);
* String value = client.get("non_existing_key").get();
* assert value.equals(null);
* }</pre>
*/
CompletableFuture<String> get(String key);
Expand All @@ -43,8 +43,8 @@ public interface StringCommands {
* @return Response from Redis containing <code>"OK"</code>.
* @example
* <pre>{@code
* String payload = client.set("key", "value").get();
* assert payload.equals("OK");
* String value = client.set("key", "value").get();
* assert value.equals("OK");
* }</pre>
*/
CompletableFuture<String> set(String key, String value);
Expand All @@ -63,13 +63,9 @@ public interface StringCommands {
* is set, return the old value as a <code>String</code>.
* @example
* <pre>{@code
* String payload =
* client.set("key", "value", SetOptions.builder()
* .conditionalSet(ONLY_IF_EXISTS)
* .expiry(SetOptions.Expiry.Seconds(5L))
* .build())
* .get();
* assert payload.equals("OK");
* SetOptions options = SetOptions.builder().conditionalSet(ONLY_IF_EXISTS).expiry(Seconds(5L)).build();
* String value = client.set("key", "value", options).get();
* assert value.equals("OK");
* }</pre>
*/
CompletableFuture<String> set(String key, String value, SetOptions options);
Expand All @@ -84,8 +80,8 @@ public interface StringCommands {
* </code>.
* @example
* <pre>{@code
* String payload = client.mget(new String[] {"key1", "key2"}).get();
* assert payload.equals(new String[] {"value1", "value2"});
* String values = client.mget(new String[] {"key1", "key2"}).get();
* assert values.equals(new String[] {"value1", "value2"});
* }</pre>
*/
CompletableFuture<String[]> mget(String[] keys);
Expand All @@ -98,8 +94,8 @@ public interface StringCommands {
* @return Always <code>OK</code>.
* @example
* <pre>{@code
* String payload = client.mset(Map.of("key1", "value1", "key2", "value2"}).get();
* assert payload.equals("OK"));
* String result = client.mset(Map.of("key1", "value1", "key2", "value2"}).get();
* assert result.equals("OK"));
* }</pre>
*/
CompletableFuture<String> mset(Map<String, String> keyValueMap);
Expand Down Expand Up @@ -147,7 +143,7 @@ public interface StringCommands {
* @return The value of <code>key</code> after the increment.
* @example
* <pre>{@code
* Long num = client.incrByFloat("key", 0.5).get();
* Double num = client.incrByFloat("key", 0.5).get();
* assert num == 7.5;
* }</pre>
*/
Expand Down

0 comments on commit d5206c2

Please sign in to comment.