Class JacksonHashMapper.JacksonHashMapperBuilder<B extends tools.jackson.databind.cfg.MapperBuilder<? extends tools.jackson.databind.ObjectMapper,? extends tools.jackson.databind.cfg.MapperBuilder<?,?>>>
java.lang.Object
org.springframework.data.redis.hash.JacksonHashMapper.JacksonHashMapperBuilder<B>
- Type Parameters:
B- type of theMapperBuilder.
- Enclosing class:
- JacksonHashMapper
public static class JacksonHashMapper.JacksonHashMapperBuilder<B extends tools.jackson.databind.cfg.MapperBuilder<? extends tools.jackson.databind.ObjectMapper,? extends tools.jackson.databind.cfg.MapperBuilder<?,?>>>
extends Object
Builder to create a
JacksonHashMapper instance.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a newJacksonHashMapperinstance with the configured settings.flatten()Use a flattened representation using dot notation.flatten(boolean flatten) Configure whether to flatten the resulting hash using dot notation for properties.Use a hierarchical node structure as created by Jackson.Enable Jackson 2 compatibility mode.typeValidator(tools.jackson.databind.jsontype.PolymorphicTypeValidator typeValidator) Provide aPolymorphicTypeValidatorto validate polymorphic types during deserialization.
-
Method Details
-
flatten
Use a flattened representation using dot notation. The default is to usehierarchical().- Returns:
thisbuilder.
-
hierarchical
Use a hierarchical node structure as created by Jackson. This is the default behavior.- Returns:
thisbuilder.
-
flatten
@Contract("_ -> this") public JacksonHashMapper.JacksonHashMapperBuilder<B> flatten(boolean flatten) Configure whether to flatten the resulting hash using dot notation for properties. The default is to usehierarchical().- Parameters:
flatten- boolean used to configure whether JSON de/serializedObjectproperties will be un/flattened using dot notation, or whether to retain the hierarchical node structure created by Jackson.- Returns:
thisbuilder.
-
jackson2CompatibilityMode
@Contract("-> this") public JacksonHashMapper.JacksonHashMapperBuilder<B> jackson2CompatibilityMode()Enable Jackson 2 compatibility mode. This enables reading values written byJackson2HashMapperand writing values that can be read byJackson2HashMapper.- Returns:
thisbuilder.
-
typeValidator
@Contract("_ -> this") public JacksonHashMapper.JacksonHashMapperBuilder<B> typeValidator(tools.jackson.databind.jsontype.PolymorphicTypeValidator typeValidator) Provide aPolymorphicTypeValidatorto validate polymorphic types during deserialization.- Parameters:
typeValidator- the validator to use, defaults to a permissive validator that allows all types.- Returns:
thisbuilder.
-
customize
@Contract("_ -> this") public JacksonHashMapper.JacksonHashMapperBuilder<B> customize(Consumer<B> mapperBuilderCustomizer) - Parameters:
mapperBuilderCustomizer- the configurer to apply to theObjectMapperbuilder.- Returns:
thisbuilder.
-
build
Build a newJacksonHashMapperinstance with the configured settings.- Returns:
- a new
JacksonHashMapperinstance.
-