Class ObjectMapperFactory

java.lang.Object
ai.pipestream.api.json.ObjectMapperFactory

@Singleton public class ObjectMapperFactory extends Object
Factory for creating consistently configured ObjectMapper instances. This ensures all JSON serialization/deserialization across the pipeline uses the same configuration. Configuration includes: - Alphabetical property sorting - Map entries ordered by keys - Snake_case naming strategy (preferred by data scientists) - ISO-8601 date/time formatting - JavaTimeModule for proper Java 8 time support
  • Constructor Details

    • ObjectMapperFactory

      public ObjectMapperFactory()
  • Method Details

    • createConfiguredMapper

      public static com.fasterxml.jackson.databind.ObjectMapper createConfiguredMapper()
      Creates a fully configured ObjectMapper with all standard settings. This is the primary method that should be used throughout the application. Returns the cached static instance for better performance.
    • produceObjectMapper

      @Singleton @Produces public com.fasterxml.jackson.databind.ObjectMapper produceObjectMapper()
      Bean producer method for CDI injection. This allows the ObjectMapper to be injected where needed.
    • createMinimalMapper

      public static com.fasterxml.jackson.databind.ObjectMapper createMinimalMapper()
      Creates a minimal ObjectMapper without ordering or special naming. Use this only when you need to match external JSON formats exactly.