You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2018/10/02 09:28:36 UTC

[3/9] james-project git commit: JAMES-2544 Cassandra MQ View configuration should be a bean

JAMES-2544 Cassandra MQ View configuration should be a bean

Implements toString 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/b90cb56b
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/b90cb56b
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/b90cb56b

Branch: refs/heads/master
Commit: b90cb56bba089cfc2cb8515dd0c61043efb418c1
Parents: c5baa44
Author: Benoit Tellier <bt...@linagora.com>
Authored: Thu Sep 27 10:42:35 2018 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Tue Oct 2 10:18:32 2018 +0700

----------------------------------------------------------------------
 .../CassandraMailQueueViewConfiguration.java    | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b90cb56b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/configuration/CassandraMailQueueViewConfiguration.java
----------------------------------------------------------------------
diff --git a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/configuration/CassandraMailQueueViewConfiguration.java b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/configuration/CassandraMailQueueViewConfiguration.java
index 697e173..2a1338b 100644
--- a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/configuration/CassandraMailQueueViewConfiguration.java
+++ b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/configuration/CassandraMailQueueViewConfiguration.java
@@ -20,7 +20,9 @@
 package org.apache.james.queue.rabbitmq.view.cassandra.configuration;
 
 import java.time.Duration;
+import java.util.Objects;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Preconditions;
 
 public class CassandraMailQueueViewConfiguration {
@@ -88,4 +90,30 @@ public class CassandraMailQueueViewConfiguration {
     public Duration getSliceWindow() {
         return sliceWindow;
     }
+
+    @Override
+    public final boolean equals(Object o) {
+        if (o instanceof CassandraMailQueueViewConfiguration) {
+            CassandraMailQueueViewConfiguration that = (CassandraMailQueueViewConfiguration) o;
+
+            return Objects.equals(this.bucketCount, that.bucketCount)
+                && Objects.equals(this.updateBrowseStartPace, that.updateBrowseStartPace)
+                && Objects.equals(this.sliceWindow, that.sliceWindow);
+        }
+        return false;
+    }
+
+    @Override
+    public final int hashCode() {
+        return Objects.hash(bucketCount, updateBrowseStartPace, sliceWindow);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+            .add("bucketCount", bucketCount)
+            .add("updateBrowseStartPace", updateBrowseStartPace)
+            .add("sliceWindow", sliceWindow)
+            .toString();
+    }
 }


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