Skip to content

Commit

Permalink
Add a no arg constructor for request grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Dec 10, 2024
1 parent f0d55b7 commit c2531d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/io/vertx/redis/client/RequestGrouping.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package io.vertx.redis.client;

import io.vertx.codegen.annotations.DataObject;
import io.vertx.codegen.annotations.GenIgnore;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
Expand All @@ -14,9 +16,15 @@
*/
@DataObject
public class RequestGrouping {

private final Collection<List<Request>> keyed;
private final List<Request> unkeyed;

public RequestGrouping() {
this.keyed = new ArrayList<>();
this.unkeyed = new ArrayList<>();
}

public RequestGrouping(Collection<List<Request>> keyed, List<Request> unkeyed) {
this.keyed = Objects.requireNonNull(keyed);
this.unkeyed = Objects.requireNonNull(unkeyed);
Expand All @@ -29,6 +37,7 @@ public RequestGrouping(Collection<List<Request>> keyed, List<Request> unkeyed) {
* Does not include any request that doesn't specify a key; use {@link #getUnkeyed()}
* to get those.
*/
@GenIgnore
public Collection<List<Request>> getKeyed() {
return keyed;
}
Expand All @@ -37,6 +46,7 @@ public Collection<List<Request>> getKeyed() {
* Returns a collection of requests that do not specify a key and would therefore
* be executed on random node.
*/
@GenIgnore
public List<Request> getUnkeyed() {
return unkeyed;
}
Expand Down

0 comments on commit c2531d9

Please sign in to comment.