Package ai.pipestream.api.json
Class ObjectMapperFactory
java.lang.Object
ai.pipestream.api.json.ObjectMapperFactory
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.ObjectMapperCreates a fully configured ObjectMapper with all standard settings.static com.fasterxml.jackson.databind.ObjectMapperCreates a minimal ObjectMapper without ordering or special naming.com.fasterxml.jackson.databind.ObjectMapperBean producer method for CDI injection.
-
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.
-