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 2020/02/27 03:32:09 UTC

[james-project] 02/08: JAMES-2813 Rename MailboxMergingTaskDTO::toDTO into toDomainObject

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 a9dd5443823261f431de89ef06df491f6f297741
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Feb 13 11:58:08 2020 +0700

    JAMES-2813 Rename MailboxMergingTaskDTO::toDTO into toDomainObject
    
    This badly named method was misleading
---
 .../mailbox/cassandra/mail/task/MailboxMergingTaskDTO.java    | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/task/MailboxMergingTaskDTO.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/task/MailboxMergingTaskDTO.java
index 2305713..70a14f5 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/task/MailboxMergingTaskDTO.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/task/MailboxMergingTaskDTO.java
@@ -30,7 +30,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 public class MailboxMergingTaskDTO implements TaskDTO {
     private static final CassandraId.Factory CASSANDRA_ID_FACTORY = new CassandraId.Factory();
 
-    private static MailboxMergingTaskDTO fromDTO(MailboxMergingTask domainObject, String typeName) {
+    private static MailboxMergingTaskDTO toDTO(MailboxMergingTask domainObject, String typeName) {
         return new MailboxMergingTaskDTO(
             typeName,
             domainObject.getContext().getTotalMessageCount(),
@@ -43,8 +43,8 @@ public class MailboxMergingTaskDTO implements TaskDTO {
         return DTOModule
             .forDomainObject(MailboxMergingTask.class)
             .convertToDTO(MailboxMergingTaskDTO.class)
-            .toDomainObjectConverter(dto -> dto.toDTO(taskRunner))
-            .toDTOConverter(MailboxMergingTaskDTO::fromDTO)
+            .toDomainObjectConverter(dto -> dto.toDomainObject(taskRunner))
+            .toDTOConverter(MailboxMergingTaskDTO::toDTO)
             .typeName(MailboxMergingTask.MAILBOX_MERGING.asString())
             .withFactory(TaskDTOModule::new);
     }
@@ -65,13 +65,12 @@ public class MailboxMergingTaskDTO implements TaskDTO {
         this.newMailboxId = newMailboxId;
     }
 
-    private MailboxMergingTask toDTO(MailboxMergingTaskRunner taskRunner) {
+    private MailboxMergingTask toDomainObject(MailboxMergingTaskRunner taskRunner) {
         return new MailboxMergingTask(
             taskRunner,
             totalMessageCount,
             CASSANDRA_ID_FACTORY.fromString(oldMailboxId),
-            CASSANDRA_ID_FACTORY.fromString(newMailboxId)
-        );
+            CASSANDRA_ID_FACTORY.fromString(newMailboxId));
     }
 
     @Override


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