package dev.coph.nextusweb.server.json; import tools.jackson.databind.ObjectMapper; /** * Holder for the application-wide Jackson {@link ObjectMapper}. * *

A single, pre-configured mapper instance is shared across the whole server because * {@code ObjectMapper} is thread-safe once configured and is relatively expensive to build. * Centralizing it here ensures every component (request parsing, response serialization, * WebSocket payloads) uses identical serialization settings.

* *

This class is a static holder and cannot be instantiated.

*/ public final class JsonMapper { /** * The shared, thread-safe Jackson mapper used throughout the server for all JSON reading * and writing. */ public static final ObjectMapper MAPPER = tools.jackson.databind.json.JsonMapper.builder() // .addModule(new JavaTimeModule()) .build(); /** * Private constructor preventing instantiation of this static holder class. */ private JsonMapper() {} }