Skip to content

Commit

Permalink
Add javadocs for trim options
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Carbonetto <[email protected]>
  • Loading branch information
acarbonetto committed Apr 1, 2024
1 parent f4735dd commit 3df1021
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public abstract static class StreamTrimOptions {

protected abstract String getThreshold();

public List<String> addTrimOptions() {
protected List<String> getRedisApi() {
List<String> optionArgs = new ArrayList<>();

optionArgs.add(this.getMethod());
Expand All @@ -67,6 +67,7 @@ public List<String> addTrimOptions() {
}
}

/** Option to trim the stream according to minimum ID. */
public static class MinId extends StreamTrimOptions {
/** Trim the stream according to entry ID. Equivalent to <code>MINID</code> in the Redis API. */
private final String threshold;
Expand Down Expand Up @@ -106,6 +107,7 @@ protected String getThreshold() {
}
}

/** Option to trim the stream according to maximum stream length. */
public static class MaxLen extends StreamTrimOptions {
/**
* Trim the stream according to length.<br>
Expand Down Expand Up @@ -161,7 +163,7 @@ public String[] toArgs() {
}

if (trim != null) {
optionArgs.addAll(trim.addTrimOptions());
optionArgs.addAll(trim.getRedisApi());
}

if (id != null) {
Expand Down

0 comments on commit 3df1021

Please sign in to comment.