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 <[email protected]> Authored: Fri Jun 2 10:29:19 2017 +0200 Committer: Antoine Duprat <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
