james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [1/8] james-project git commit: JAMES-2044 Introduce a search criterion for sent date
Date Fri, 02 Jun 2017 12:02:16 GMT
Repository: james-project
Updated Branches:
  refs/heads/master f19648a51 -> a34bc332e


JAMES-2044 Introduce a search criterion for sent date


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/bea5ac17
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/bea5ac17
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/bea5ac17

Branch: refs/heads/master
Commit: bea5ac17f0b7b6605732b76fc19d4b05cf1ff825
Parents: f19648a
Author: Antoine Duprat <aduprat@linagora.com>
Authored: Fri Jun 2 10:29:19 2017 +0200
Committer: Antoine Duprat <aduprat@linagora.com>
Committed: Fri Jun 2 10:29:19 2017 +0200

----------------------------------------------------------------------
 .../apache/james/mailbox/model/SearchQuery.java | 41 ++++++++++++++++++++
 1 file changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/bea5ac17/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java b/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
index 6c7e1cc..2006502 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
@@ -32,6 +32,7 @@ import javax.mail.Flags;
 import javax.mail.Flags.Flag;
 
 import org.apache.james.mailbox.MessageUid;
+
 import com.google.common.base.MoreObjects;
 import com.google.common.base.Objects;
 
@@ -1189,6 +1190,46 @@ public class SearchQuery implements Serializable {
     }
 
     /**
+     * Filters on the sent date.
+     */
+    public static class SentDateCriterion extends Criterion {
+        private static final long serialVersionUID = 1L;
+
+        private final DateOperator operator;
+
+        public SentDateCriterion(DateOperator operator) {
+            super();
+            this.operator = operator;
+        }
+
+        public DateOperator getOperator() {
+            return operator;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hashCode(operator);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj instanceof SentDateCriterion) {
+                SentDateCriterion that = (SentDateCriterion) obj;
+
+                return Objects.equal(this.operator, that.operator);
+            }
+            return false;
+        }
+
+        @Override
+        public String toString() {
+            return MoreObjects.toStringHelper(this)
+                .add("operator", operator)
+                .toString();
+        }
+    }
+
+    /**
      * Filters on the mod-sequence of the messages.
      */
     public static class ModSeqCriterion extends Criterion {


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message