Class Jackson3HashMapper.Jackson3HashMapperBuilder<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.Jackson3HashMapper.Jackson3HashMapperBuilder<B>
- Type Parameters:
B
- type of theMapperBuilder
.
- Enclosing class:
- Jackson3HashMapper
public static class Jackson3HashMapper.Jackson3HashMapperBuilder<B extends tools.jackson.databind.cfg.MapperBuilder<? extends tools.jackson.databind.ObjectMapper,? extends tools.jackson.databind.cfg.MapperBuilder<?,?>>>
extends Object
Builder to create a
Jackson3HashMapper
instance.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build a newJackson3HashMapper
instance 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 aPolymorphicTypeValidator
to validate polymorphic types during deserialization.
-
Method Details
-
flatten
Use a flattened representation using dot notation. The default is to usehierarchical()
.- Returns:
this
builder.
-
hierarchical
Use a hierarchical node structure as created by Jackson. This is the default behavior.- Returns:
this
builder.
-
flatten
@Contract("_ -> this") public Jackson3HashMapper.Jackson3HashMapperBuilder<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/serializedObject
properties will be un/flattened using dot notation, or whether to retain the hierarchical node structure created by Jackson.- Returns:
this
builder.
-
jackson2CompatibilityMode
@Contract("-> this") public Jackson3HashMapper.Jackson3HashMapperBuilder<B> jackson2CompatibilityMode()Enable Jackson 2 compatibility mode. This enables reading values written byJackson2HashMapper
and writing values that can be read byJackson2HashMapper
.- Returns:
this
builder.
-
typeValidator
@Contract("_ -> this") public Jackson3HashMapper.Jackson3HashMapperBuilder<B> typeValidator(tools.jackson.databind.jsontype.PolymorphicTypeValidator typeValidator) Provide aPolymorphicTypeValidator
to validate polymorphic types during deserialization.- Parameters:
typeValidator
- the validator to use, defaults to a permissive validator that allows all types.- Returns:
this
builder.
-
customize
@Contract("_ -> this") public Jackson3HashMapper.Jackson3HashMapperBuilder<B> customize(Consumer<B> mapperBuilderCustomizer) - Parameters:
mapperBuilderCustomizer
- the configurer to apply to theObjectMapper
builder.- Returns:
this
builder.
-
build
Build a newJackson3HashMapper
instance with the configured settings.- Returns:
- a new
Jackson3HashMapper
instance.
-