You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2021/05/25 08:58:30 UTC

[james-project] 01/05: JAMES-3516 Define ThreadId POJO

This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit f51daec1092dee00af37dd28ed94c805ce8a714b
Author: quanth <hq...@linagora.com>
AuthorDate: Fri May 21 14:15:35 2021 +0700

    JAMES-3516 Define ThreadId POJO
---
 .../org/apache/james/mailbox/model/ThreadId.java   | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/model/ThreadId.java b/mailbox/api/src/main/java/org/apache/james/mailbox/model/ThreadId.java
new file mode 100644
index 0000000..1f76adf
--- /dev/null
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/ThreadId.java
@@ -0,0 +1,58 @@
+/******************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one     *
+ * or more contributor license agreements.  See the NOTICE file   *
+ * distributed with this work for additional information          *
+ * regarding copyright ownership.  The ASF licenses this file     *
+ * to you under the Apache License, Version 2.0 (the              *
+ * "License"); you may not use this file except in compliance     *
+ * with the License.  You may obtain a copy of the License at     *
+ *                                                                *
+ * http://www.apache.org/licenses/LICENSE-2.0                     *
+ *                                                                *
+ * Unless required by applicable law or agreed to in writing,     *
+ * software distributed under the License is distributed on an    *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY         *
+ * KIND, either express or implied.  See the License for the      *
+ * specific language governing permissions and limitations        *
+ * under the License.                                             *
+ ******************************************************************/
+
+package org.apache.james.mailbox.model;
+
+import java.util.Objects;
+
+import com.google.common.base.MoreObjects;
+
+
+public class ThreadId {
+    private final MessageId baseMessageId;
+
+    public ThreadId(MessageId baseMessageId) {
+        this.baseMessageId = baseMessageId;
+    }
+
+    public MessageId getBaseMessageId() {
+        return baseMessageId;
+    }
+
+    @Override
+    public final boolean equals(Object o) {
+        if (o instanceof ThreadId) {
+            ThreadId that = (ThreadId) o;
+            return Objects.equals(this.baseMessageId, that.baseMessageId);
+        }
+        return false;
+    }
+
+    @Override
+    public final int hashCode() {
+        return Objects.hashCode(baseMessageId);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+            .add("baseMessageId", baseMessageId)
+            .toString();
+    }
+}

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