diff --git a/java/client/src/main/java/glide/api/commands/GenericBaseCommands.java b/java/client/src/main/java/glide/api/commands/GenericBaseCommands.java index e7a47bf279..adc7f97795 100644 --- a/java/client/src/main/java/glide/api/commands/GenericBaseCommands.java +++ b/java/client/src/main/java/glide/api/commands/GenericBaseCommands.java @@ -18,6 +18,11 @@ public interface GenericBaseCommands { * @see redis.io for details. * @param keys The keys we wanted to remove. * @return The number of keys that were removed. + * @example + *
+ * Long num = client.del(new String[] {"key1", "key2"}).get() + * assert num == 2l; + **/ CompletableFuture
keys
*
multiple times, it will be counted multiple times.
* @example
- *
*
- * long result = client.exists(new String[] {"my_key", "invalid_key"}).get();
+ *
+ *
*/
CompletableFuture
+ * Long result = client.exists(new String[] {"my_key", "invalid_key"}).get();
* assert result == 1L;
- *
keys
that were unlinked.
* @example
- *
- * long result = client.unlink("my_key").get();
+ * Long result = client.unlink("my_key").get();
* assert result == 1L;
*
*/
diff --git a/java/client/src/main/java/glide/api/commands/GenericClusterCommands.java b/java/client/src/main/java/glide/api/commands/GenericClusterCommands.java
index 1fbca154cc..f92d2582ac 100644
--- a/java/client/src/main/java/glide/api/commands/GenericClusterCommands.java
+++ b/java/client/src/main/java/glide/api/commands/GenericClusterCommands.java
@@ -26,12 +26,13 @@ public interface GenericClusterCommands {
* response (such as XREAD), or that change the client's behavior (such as entering
* pub/sub mode on RESP2 connections) shouldn't be called using
* this function.
- * @example Returns a list of all pub/sub clients:
- *
- * Object result = client.customCommand(new String[]{ "CLIENT", "LIST", "TYPE", "PUBSUB" }).get();
- *
* @param args Arguments for the custom command including the command name.
* @return Response from Redis containing an Object
.
+ * @example
+ *
+ * ClusterValue
*/
CompletableFuture
- * Object result = client.customCommand(new String[]{ "CLIENT", "LIST", "TYPE", "PUBSUB" }, RANDOM).get();
- *
* @param args Arguments for the custom command including the command name
* @param route Routing configuration for the command
* @return Response from Redis containing an Object
.
+ * @example
+ *
+ * ClusterValue<Object> result = clusterClient.customCommand(new String[]{ "CONFIG", "GET", "maxmemory"}, ALL_NODES).get();
+ * Map<String, Object> payload = result.getMultiValue();
+ * assert ((String) payload.get("node1")).equals("1GB");
+ * assert ((String) payload.get("node2")).equals("100MB");
+ *
*/
CompletableFutureWATCH
command, exec
will
* return null
.
*
+ *
+ * @example
+ *
+ * ClusterTransaction transaction = new ClusterTransaction().customCommand(new String[] {"info"});
+ * Object[] result = clusterClient.exec(transaction).get();
+ * assert ((String) result[0]).contains("# Stats");
+ *
*/
CompletableFuture