From 095f428b2fd4e1fc51b3842a6696eaebf37abaa8 Mon Sep 17 00:00:00 2001 From: JeremyTubongbanua Date: Mon, 24 Oct 2022 18:50:49 -0400 Subject: [PATCH] feat: NotifyListVerbBuilder --- .../java/org/atsign/common/VerbBuilders.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/at_client/src/main/java/org/atsign/common/VerbBuilders.java b/at_client/src/main/java/org/atsign/common/VerbBuilders.java index a4823be9..8aeb97e6 100644 --- a/at_client/src/main/java/org/atsign/common/VerbBuilders.java +++ b/at_client/src/main/java/org/atsign/common/VerbBuilders.java @@ -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; + } + + } + }