package com.s24.redjob.worker;

import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;

import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * {@link RedisSerializer} for {@link Execution}s.
 */
public class ExecutionRedisSerializer extends Jackson2JsonRedisSerializer<Execution> {
   /**
    * Object mapper.
    */
   private ObjectMapper objectMapper = new ObjectMapper();

   /**
    * Constructor.
    */
   public ExecutionRedisSerializer() {
      super(Execution.class);
      setObjectMapper(objectMapper);
   }

   /**
    * Object mapper.
    */
   public ObjectMapper getObjectMapper() {
      return objectMapper;
   }

   @Override
   public void setObjectMapper(ObjectMapper objectMapper) {
      objectMapper.registerSubtypes(Result.class);
      super.setObjectMapper(objectMapper);
      this.objectMapper = objectMapper;
   }
}

@@ -166,24 +166,70 @@
 erializer;%0A%0A
+import com.fasterxml.jackson.databind.Module;%0A
 import com.f
@@ -977,11 +977,333 @@
 er;%0A   %7D
+%0A%0A   /**%0A    * Add additional sub types to the object mapper.%0A    */%0A   public void setTypes(Class... types) %7B%0A      objectMapper.registerSubtypes(types);%0A   %7D%0A%0A   /**%0A    * Add additional modules to the object mapper.%0A    */%0A   public void setModules(Module... modules) %7B%0A      objectMapper.registerModules(modules);%0A   %7D
 %0A%7D%0A

Make modules configurable