This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit d79c61fa622309a1a0329ebc7294fcab89b6d1ac Author: Benoit Tellier <btell...@linagora.com> AuthorDate: Fri Jul 5 11:43:33 2019 +0200 JAMES-2810 DeletedMessageIdentifier POJO Will save us a Pair usage later on. --- .../deleted-messages-vault-cassandra/pom.xml | 5 ++ .../vault/metadata/DeletedMessageIdentifier.java | 59 ++++++++++++++++++++++ .../metadata/DeletedMessageIdentifierTest.java | 31 ++++++++++++ 3 files changed, 95 insertions(+) diff --git a/mailbox/plugin/deleted-messages-vault-cassandra/pom.xml b/mailbox/plugin/deleted-messages-vault-cassandra/pom.xml index 5f2e5cd..c430b55 100644 --- a/mailbox/plugin/deleted-messages-vault-cassandra/pom.xml +++ b/mailbox/plugin/deleted-messages-vault-cassandra/pom.xml @@ -50,6 +50,11 @@ <artifactId>apache-james-mailbox-deleted-messages-vault</artifactId> </dependency> <dependency> + <groupId>nl.jqno.equalsverifier</groupId> + <artifactId>equalsverifier</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <scope>test</scope> diff --git a/mailbox/plugin/deleted-messages-vault-cassandra/src/main/java/org/apache/james/vault/metadata/DeletedMessageIdentifier.java b/mailbox/plugin/deleted-messages-vault-cassandra/src/main/java/org/apache/james/vault/metadata/DeletedMessageIdentifier.java new file mode 100644 index 0000000..773ab31 --- /dev/null +++ b/mailbox/plugin/deleted-messages-vault-cassandra/src/main/java/org/apache/james/vault/metadata/DeletedMessageIdentifier.java @@ -0,0 +1,59 @@ +/**************************************************************** + * 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.vault.metadata; + +import java.util.Objects; + +import org.apache.james.core.User; +import org.apache.james.mailbox.model.MessageId; + +public class DeletedMessageIdentifier { + private final User owner; + private final MessageId messageId; + + public DeletedMessageIdentifier(User owner, MessageId messageId) { + this.owner = owner; + this.messageId = messageId; + } + + public User getOwner() { + return owner; + } + + public MessageId getMessageId() { + return messageId; + } + + @Override + public final boolean equals(Object o) { + if (o instanceof DeletedMessageIdentifier) { + DeletedMessageIdentifier that = (DeletedMessageIdentifier) o; + + return Objects.equals(this.owner, that.owner) + && Objects.equals(this.messageId, that.messageId); + } + return false; + } + + @Override + public final int hashCode() { + return Objects.hash(owner, messageId); + } +} diff --git a/mailbox/plugin/deleted-messages-vault-cassandra/src/test/java/org/apache/james/vault/metadata/DeletedMessageIdentifierTest.java b/mailbox/plugin/deleted-messages-vault-cassandra/src/test/java/org/apache/james/vault/metadata/DeletedMessageIdentifierTest.java new file mode 100644 index 0000000..e9817be --- /dev/null +++ b/mailbox/plugin/deleted-messages-vault-cassandra/src/test/java/org/apache/james/vault/metadata/DeletedMessageIdentifierTest.java @@ -0,0 +1,31 @@ +/**************************************************************** + * 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.vault.metadata; + +import org.junit.jupiter.api.Test; + +import nl.jqno.equalsverifier.EqualsVerifier; + +class DeletedMessageIdentifierTest { + @Test + void shouldMatchBeanContract() { + EqualsVerifier.forClass(DeletedMessageIdentifier.class).verify(); + } +} \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org