Skip to content

Commit

Permalink
feat: NotifyListVerbBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyTubongbanua committed Nov 1, 2022
1 parent 54339e3 commit 095f428
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions at_client/src/main/java/org/atsign/common/VerbBuilders.java
Original file line number Diff line number Diff line change
Expand Up @@ -728,4 +728,41 @@ public String build() {
}
}

public static class NotifyListVerbBuilder implements VerbBuilder {

// get a list of notification json objects by running `notify:list`

private String regex; // optional
private Long from; // optional (epochMillis notification created)
private Long to; // optional (epochMillis notification created)

public void setRegex(String regex) {
this.regex = regex;
}

public void setFrom(Long from) {
this.from = from;
}

public void setTo(Long to) {
this.to = to;
}

@Override
public String build() {
String b = "notify:list";
if(from != null) {
b += ":" + from;
}
if(to != null) {
b += ":" + to;
}
if (regex != null) {
b += ":" + regex;
}
return b;
}

}

}

0 comments on commit 095f428

Please sign in to comment.