Package org.sdase.commons.server.jackson
Class ObjectMapperConfigurationUtil.Builder
- java.lang.Object
-
- org.sdase.commons.server.jackson.ObjectMapperConfigurationUtil.Builder
-
- Enclosing class:
- ObjectMapperConfigurationUtil
public static class ObjectMapperConfigurationUtil.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectMapperConfigurationUtil.Builder
alwaysWriteZonedDateTimeWithMillis()
Registers a default serializer forZonedDateTime
that renders 3 digits of milliseconds.ObjectMapperConfigurationUtil.Builder
alwaysWriteZonedDateTimeWithoutMillis()
Registers a default serializer forZonedDateTime
that renders no milliseconds.com.fasterxml.jackson.databind.ObjectMapper
build()
ObjectMapperConfigurationUtil.Builder
withCustomization(java.util.function.Consumer<com.fasterxml.jackson.databind.ObjectMapper> customizer)
Allows customization of theObjectMapper
.ObjectMapperConfigurationUtil.Builder
withoutHalSupport()
Skips registration of the HAL module.
-
-
-
Method Detail
-
withoutHalSupport
public ObjectMapperConfigurationUtil.Builder withoutHalSupport()
Skips registration of the HAL module. This may be used when links and embedded resources are not required or are achieved with other tooling.- Returns:
- the builder
-
withCustomization
public ObjectMapperConfigurationUtil.Builder withCustomization(java.util.function.Consumer<com.fasterxml.jackson.databind.ObjectMapper> customizer)
Allows customization of theObjectMapper
. More customizers may be added by calling this method multiple times.- Parameters:
customizer
- receives theObjectMapper
for customization, e.g. to enable or disable specific features or configure formatting.- Returns:
- the builder
-
alwaysWriteZonedDateTimeWithMillis
public ObjectMapperConfigurationUtil.Builder alwaysWriteZonedDateTimeWithMillis()
Registers a default serializer forZonedDateTime
that renders 3 digits of milliseconds. The same serializer may be configured per field as documented inIso8601Serializer.WithMillis
.This setting overwrites the default behaviour of Jackson which omits milliseconds if they are zero or adds nanoseconds if they are set.
- Returns:
- the builder
-
alwaysWriteZonedDateTimeWithoutMillis
public ObjectMapperConfigurationUtil.Builder alwaysWriteZonedDateTimeWithoutMillis()
Registers a default serializer forZonedDateTime
that renders no milliseconds. The same serializer may be configured per field as documented inIso8601Serializer
.This setting overwrites the default behaviour of Jackson which omits milliseconds if they are zero or adds nanoseconds if they are set.
- Returns:
- the builder
-
build
public com.fasterxml.jackson.databind.ObjectMapper build()
-
-