MAILBOX-362 MailboxACLUpdated should implement equals and hashcode
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/892f95a1 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/892f95a1 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/892f95a1 Branch: refs/heads/master Commit: 892f95a19a8b366f830e044bcf5c5dd8e1478c5c Parents: 6000b48 Author: datph <[email protected]> Authored: Tue Dec 18 11:01:44 2018 +0700 Committer: Benoit Tellier <[email protected]> Committed: Wed Dec 19 10:55:53 2018 +0700 ---------------------------------------------------------------------- .../apache/james/mailbox/MailboxListener.java | 19 +++++++++++++++++++ .../james/mailbox/MailboxListenerTest.java | 5 +++++ 2 files changed, 24 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/892f95a1/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxListener.java ---------------------------------------------------------------------- diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxListener.java b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxListener.java index bbd5e4a..b3d4785 100644 --- a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxListener.java +++ b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxListener.java @@ -323,6 +323,25 @@ public interface MailboxListener { return aclDiff; } + @Override + public final boolean equals(Object o) { + if (o instanceof MailboxACLUpdated) { + MailboxACLUpdated that = (MailboxACLUpdated) o; + + return Objects.equals(this.sessionId, that.sessionId) + && Objects.equals(this.user, that.user) + && Objects.equals(this.path, that.path) + && Objects.equals(this.aclDiff, that.aclDiff) + && Objects.equals(this.mailboxId, that.mailboxId); + } + return false; + } + + @Override + public final int hashCode() { + return Objects.hash(sessionId, user, path, aclDiff, mailboxId); + } + } /** http://git-wip-us.apache.org/repos/asf/james-project/blob/892f95a1/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxListenerTest.java ---------------------------------------------------------------------- diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxListenerTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxListenerTest.java index 0e28d17..ac9c364 100644 --- a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxListenerTest.java +++ b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxListenerTest.java @@ -38,4 +38,9 @@ class MailboxListenerTest { void mailboxDeletionShouldMatchBeanContract() { EqualsVerifier.forClass(MailboxListener.MailboxDeletion.class).verify(); } + + @Test + void mailboxACLUpdatedShouldMatchBeanContract() { + EqualsVerifier.forClass(MailboxListener.MailboxACLUpdated.class).verify(); + } } \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
