Skip to content

Commit

Permalink
Non-nullable cursors
Browse files Browse the repository at this point in the history
  • Loading branch information
jduo committed Jun 28, 2024
1 parent 96cf8e3 commit 34ab37f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions java/client/src/main/java/glide/api/BaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2803,14 +2803,14 @@ public CompletableFuture<Object[]> sscan(
}

@Override
public CompletableFuture<Object[]> zscan(@NonNull String key, String cursor) {
public CompletableFuture<Object[]> zscan(@NonNull String key, @NonNull String cursor) {
String[] arguments = new String[] {key, cursor};
return commandManager.submitNewCommand(ZScan, arguments, this::handleArrayResponse);
}

@Override
public CompletableFuture<Object[]> zscan(
@NonNull String key, String cursor, @NonNull ZScanOptions zScanOptions) {
@NonNull String key, @NonNull String cursor, @NonNull ZScanOptions zScanOptions) {
String[] arguments = concatenateArrays(new String[] {key, cursor}, zScanOptions.toArgs());
return commandManager.submitNewCommand(ZScan, arguments, this::handleArrayResponse);
}
Expand Down
30 changes: 14 additions & 16 deletions java/client/src/main/java/glide/api/models/BaseTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -5172,14 +5172,13 @@ public T sscan(@NonNull String key, @NonNull String cursor, @NonNull SScanOption
* @param key The key of the set.
* @param cursor The cursor that points to the next iteration of results.
* @return Command Response - An <code>Array</code> of <code>Objects</code>. The first element is
* always the <code>
* cursor</code> for the next iteration of results. <code>0</code> will be the <code>cursor
* </code> returned on the last iteration of the set. The second element is always an <code>
* Array</code> of the subset of the set held in <code>key</code>. The array in the second
* element is always a flattened series of String pairs, where the value is at even indices
* and the score is at odd indices.
*/
public T zscan(@NonNull String key, String cursor) {
* always the <code>cursor</code> for the next iteration of results. <code>0</code> will be
* the <code>cursor</code> returned on the last iteration of the set. The second element is
* always an <code>Array</code> of the subset of the set held in <code>key</code>. The array
* in the second element is always a flattened series of String pairs, where the value is at
* even indices and the score is at odd indices.
*/
public T zscan(@NonNull String key, @NonNull String cursor) {
protobufTransaction.addCommands(buildCommand(ZScan, buildArgs(key, cursor)));
return getThis();
}
Expand All @@ -5192,14 +5191,13 @@ public T zscan(@NonNull String key, String cursor) {
* @param cursor The cursor that points to the next iteration of results.
* @param zScanOptions The {@link ZScanOptions}.
* @return Command Response - An <code>Array</code> of <code>Objects</code>. The first element is
* always the <code>
* cursor</code> for the next iteration of results. <code>0</code> will be the <code>cursor
* </code> returned on the last iteration of the set. The second element is always an <code>
* Array</code> of the subset of the set held in <code>key</code>. The array in the second
* element is always a flattened series of String pairs, where the value is at even indices
* and the score is at odd indices.
*/
public T zscan(@NonNull String key, String cursor, @NonNull ZScanOptions zScanOptions) {
* always the <code>cursor</code> for the next iteration of results. <code>0</code> will be
* the <code>cursor</code> returned on the last iteration of the set. The second element is
* always an <code>Array</code> of the subset of the set held in <code>key</code>. The array
* in the second element is always a flattened series of String pairs, where the value is at
* even indices and the score is at odd indices.
*/
public T zscan(@NonNull String key, @NonNull String cursor, @NonNull ZScanOptions zScanOptions) {
ArgsArray commandArgs =
buildArgs(concatenateArrays(new String[] {key, cursor}, zScanOptions.toArgs()));
protobufTransaction.addCommands(buildCommand(ZScan, commandArgs));
Expand Down

0 comments on commit 34ab37f

Please sign in to comment.