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 2019/11/20 07:32:11 UTC
[james-project] 28/41: JAMES-2813 extract EventNestedTypes string
to a constant
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 22b3b482b6c6a4f3a7e4c9e02daea45e54f46e45
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Tue Nov 5 17:20:31 2019 +0100
JAMES-2813 extract EventNestedTypes string to a constant
---
.../james/eventsourcing/eventstore/cassandra/JsonEventSerializer.java | 4 +++-
.../main/java/org/apache/james/modules/TaskSerializationModule.java | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/event-sourcing/event-store-cassandra/src/main/java/org/apache/james/eventsourcing/eventstore/cassandra/JsonEventSerializer.java b/event-sourcing/event-store-cassandra/src/main/java/org/apache/james/eventsourcing/eventstore/cassandra/JsonEventSerializer.java
index 9c3b447..b1bb6bc 100644
--- a/event-sourcing/event-store-cassandra/src/main/java/org/apache/james/eventsourcing/eventstore/cassandra/JsonEventSerializer.java
+++ b/event-sourcing/event-store-cassandra/src/main/java/org/apache/james/eventsourcing/eventstore/cassandra/JsonEventSerializer.java
@@ -39,6 +39,8 @@ import com.google.common.collect.ImmutableSet;
public class JsonEventSerializer {
+ public static final String EVENT_NESTED_TYPES_INJECTION_NAME = "EventNestedTypes";
+
public static RequireNestedConfiguration forModules(Set<? extends EventDTOModule<?, ?>> modules) {
return nestedTypesModules -> {
ImmutableSet<EventDTOModule<?, ?>> dtoModules = ImmutableSet.copyOf(modules);
@@ -82,7 +84,7 @@ public class JsonEventSerializer {
private JsonGenericSerializer<Event, EventDTO> jsonGenericSerializer;
@Inject
- private JsonEventSerializer(Set<EventDTOModule<?, ?>> modules, @Named("EventNestedTypes") Set<DTOModule<?, ?>> nestedTypesModules) {
+ private JsonEventSerializer(Set<EventDTOModule<?, ?>> modules, @Named(EVENT_NESTED_TYPES_INJECTION_NAME) Set<DTOModule<?, ?>> nestedTypesModules) {
jsonGenericSerializer = JsonGenericSerializer.forModules(modules).withNestedTypeModules(nestedTypesModules);
}
diff --git a/server/container/guice/cassandra-rabbitmq-guice/src/main/java/org/apache/james/modules/TaskSerializationModule.java b/server/container/guice/cassandra-rabbitmq-guice/src/main/java/org/apache/james/modules/TaskSerializationModule.java
index f901b57..a30fe93 100644
--- a/server/container/guice/cassandra-rabbitmq-guice/src/main/java/org/apache/james/modules/TaskSerializationModule.java
+++ b/server/container/guice/cassandra-rabbitmq-guice/src/main/java/org/apache/james/modules/TaskSerializationModule.java
@@ -18,6 +18,8 @@
****************************************************************/
package org.apache.james.modules;
+import static org.apache.james.eventsourcing.eventstore.cassandra.JsonEventSerializer.EVENT_NESTED_TYPES_INJECTION_NAME;
+
import java.time.Clock;
import java.util.Set;
@@ -345,7 +347,7 @@ public class TaskSerializationModule extends AbstractModule {
return UserReindexingTaskAdditionalInformationDTO.serializationModule(mailboxIdFactory);
}
- @Named("EventNestedTypes")
+ @Named(EVENT_NESTED_TYPES_INJECTION_NAME)
@Provides
public Set<DTOModule<?, ?>> eventNestedTypes(Set<AdditionalInformationDTOModule<?, ?>> additionalInformationDTOModules,
Set<TaskDTOModule<?, ?>> taskDTOModules) {
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org