From 83e33bb0832a71601414376d9285bdbde96dbcf4 Mon Sep 17 00:00:00 2001 From: SanHalacogluImproving Date: Tue, 5 Mar 2024 09:41:26 -0800 Subject: [PATCH] Stylistic documentation changes for ListBaseCommands. --- .../glide/api/commands/ListBaseCommands.java | 92 ++++++++++--------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/java/client/src/main/java/glide/api/commands/ListBaseCommands.java b/java/client/src/main/java/glide/api/commands/ListBaseCommands.java index 053f0d6697..41185adfc6 100644 --- a/java/client/src/main/java/glide/api/commands/ListBaseCommands.java +++ b/java/client/src/main/java/glide/api/commands/ListBaseCommands.java @@ -21,12 +21,13 @@ public interface ListBaseCommands { * @param elements The elements to insert at the head of the list stored at key. * @return The length of the list after the push operations. * @example - *
-     * Long pushCount1 = client.lpush("my_list", new String[] {"value1", "value2"}).get()
-     * assert pushCount1 == 2L
-     * Long pushCount2 = client.lpush("nonexistent_list", new String[] {"new_value"}).get()
-     * assert pushCount2 == 1L
-     * 
+ *
{@code
+     * Long pushCount1 = client.lpush("my_list", new String[] {"value1", "value2"}).get();
+     * assert pushCount1 == 2L;
+     *
+     * Long pushCount2 = client.lpush("nonexistent_list", new String[] {"new_value"}).get();
+     * assert pushCount2 == 1L;
+     * }
*/ CompletableFuture lpush(String key, String[] elements); @@ -39,12 +40,13 @@ public interface ListBaseCommands { * @return The value of the first element.
* If key does not exist, null will be returned.
* @example - *
-     * String value1 = client.lpop("my_list").get()
-     * assert value1.equals("value1")
-     * String value2 = client.lpop("non_exiting_key").get()
-     * assert value2.equals(null)
-     * 
+ *
{@code
+     * String value1 = client.lpop("my_list").get();
+     * assert value1.equals("value1");
+     *
+     * String value2 = client.lpop("non_exiting_key").get();
+     * assert value2.equals(null);
+     * }
*/ CompletableFuture lpop(String key); @@ -58,12 +60,13 @@ public interface ListBaseCommands { * @return An array of the popped elements will be returned depending on the list's length.
* If key does not exist, null will be returned.
* @example - *
-     * String[] values1 = client.lpopCount("my_list", 2).get()
-     * assert values1.equals(new String[] {"value1", "value2"})
-     * String[] values2 = client.lpopCount("non_exiting_key" , 7).get()
-     * assert values2.equals(null)
-     * 
+ *
{@code
+     * String[] values1 = client.lpopCount("my_list", 2).get();
+     * assert values1.equals(new String[] {"value1", "value2"});
+     *
+     * String[] values2 = client.lpopCount("non_exiting_key" , 7).get();
+     * assert values2.equals(null);
+     * }
*/ CompletableFuture lpopCount(String key, long count); @@ -85,14 +88,16 @@ public interface ListBaseCommands { * end of the list.
* If key does not exist an empty array will be returned.
* @example - *
+     *     
{@code
      * 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("non_exiting_key", 0, 2).get()
      * assert payload.equals(new String[] {})
-     * 
+ * }
*/ CompletableFuture lrange(String key, long start, long end); @@ -115,10 +120,10 @@ public interface ListBaseCommands { * element of the list.
* If key does not exist, OK will be returned without changes to the database. * @example - *
-     * String payload = client.ltrim("my_list", 0, 1).get()
-     * assert payload.equals("OK")
-     * 
+ *
{@code
+     * String payload = client.ltrim("my_list", 0, 1).get();
+     * assert payload.equals("OK");
+     * }
*/ CompletableFuture ltrim(String key, long start, long end); @@ -130,10 +135,10 @@ public interface ListBaseCommands { * @return The length of the list at key.
* If key does not exist, it is interpreted as an empty list and 0 is returned. * @example - *
-     * Long lenList = client.llen("my_list").get()
-     * assert lenList == 3L //Indicates that there are 3 elements in the list.
-     * 
+ *
{@code
+     * Long lenList = client.llen("my_list").get();
+     * assert lenList == 3L //Indicates that there are 3 elements in the list.;
+     * }
*/ CompletableFuture llen(String key); @@ -148,12 +153,13 @@ public interface ListBaseCommands { * @param elements The elements to insert at the tail of the list stored at key. * @return The length of the list after the push operations. * @example - *
+     *     
{@code
      * 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
-     * 
+ * }
*/ CompletableFuture rpush(String key, String[] elements); @@ -166,12 +172,13 @@ public interface ListBaseCommands { * @return The value of the last element.
* If key does not exist, null will be returned.
* @example - *
-     * String value1 = client.rpop("my_list").get()
-     * assert value1.equals("value1")
-     * String value2 = client.rpop("non_exiting_key").get()
-     * assert value2.equals(null)
-     * 
+ *
{@code
+     * String value1 = client.rpop("my_list").get();
+     * assert value1.equals("value1");
+     *
+     * String value2 = client.rpop("non_exiting_key").get();
+     * assert value2.equals(null);
+     * }
*/ CompletableFuture rpop(String key); @@ -184,12 +191,13 @@ public interface ListBaseCommands { * @returns An array of popped elements will be returned depending on the list's length.
* If key does not exist, null will be returned.
* @example - *
-     * String[] values1 = client.rpopCount("my_list", 2).get()
-     * assert values1.equals(new String[] {"value1", "value2"})
-     * String[] values2 = client.rpopCount("non_exiting_key" , 7).get()
-     * assert values2.equals(null)
-     * 
+ *
{@code
+     * String[] values1 = client.rpopCount("my_list", 2).get();
+     * assert values1.equals(new String[] {"value1", "value2"});
+     *
+     * String[] values2 = client.rpopCount("non_exiting_key" , 7).get();
+     * assert values2.equals(null);
+     * }
*/ CompletableFuture rpopCount(String key, long count); }