X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fbatch%2Fapprovalsets%2FPending.java;h=5d720c2f63bae09b38ffe0d4a89f9e3f27b4d067;hb=889a9891f6df5bbb26a760cfb106be947e87aa5c;hp=3072038a097c1eb1998c3558745d6c18d1e43e67;hpb=a50007dcded86acc2dcd610810f8afac720a058a;p=aaf%2Fauthz.git diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Pending.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Pending.java index 3072038a..5d720c2f 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Pending.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Pending.java @@ -34,15 +34,6 @@ public class Pending { boolean hasNew; Date earliest; - /** - * Use this Constructor when there is no Last Notified Date - */ - public Pending() { - qty = 1; - hasNew = true; - earliest = null; - } - /** * Use this constructor to indicate when last Notified * @param last_notified @@ -84,6 +75,11 @@ public class Pending { public void inc(Pending value) { qty+=value.qty; + if(earliest==null) { + earliest = value.earliest; + } else if(value.earliest!=null && value.earliest.before(earliest)) { + earliest = value.earliest; + } } public void earliest(Date lastnotified) { @@ -106,4 +102,8 @@ public class Pending { return hasNew; } + public static Pending create() { + return new Pending((Date)null); + } + } \ No newline at end of file