Class GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<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.serializer.GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B>
- Type Parameters:
B- type of theMapperBuilder.
- Enclosing class:
GenericJackson3JsonRedisSerializer
public static class GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B extends tools.jackson.databind.cfg.MapperBuilder<? extends tools.jackson.databind.ObjectMapper, ? extends tools.jackson.databind.cfg.MapperBuilder<?,?>>>
extends Object
GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder wraps around a JsonMapper.Builder providing dedicated
methods to configure aspects like NullValue serialization strategy for the resulting ObjectMapper
to be used with GenericJackson3JsonRedisSerializer as well as potential Object/-reader and -writer settings.- Since:
- 4.0
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a newGenericJackson3JsonRedisSerializerinstance using the configured settings.enableDefaultTyping(tools.jackson.databind.jsontype.PolymorphicTypeValidator typeValidator) Enablesdefault typingusing the givenPolymorphicTypeValidator.Registers aStdSerializercapable of serializing Spring CacheNullValueusing the mappers default type property.enableSpringCacheNullValueSupport(String typePropertyName) Registers aStdSerializercapable of serializing Spring CacheNullValueusing the given type property name.Enablesdefault typingwithout any type validation constraints.reader(Jackson3ObjectReader reader) Configures theJackson3ObjectReader.typePropertyName(String typePropertyName) Configure the type property name used for default typing andenableSpringCacheNullValueSupport().typeValidator(tools.jackson.databind.jsontype.PolymorphicTypeValidator typeValidator) Provide aPolymorphicTypeValidatorto validate polymorphic types during deserialization.writer(Jackson3ObjectWriter writer) Configures theJackson3ObjectWriter.
-
Method Details
-
enableSpringCacheNullValueSupport
@Contract("-> this") public GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B> enableSpringCacheNullValueSupport()Registers aStdSerializercapable of serializing Spring CacheNullValueusing the mappers default type property. Please make sure to activedefault typingaccordingly.- Returns:
- this.
-
enableSpringCacheNullValueSupport
@Contract("_ -> this") public GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B> enableSpringCacheNullValueSupport(String typePropertyName) Registers aStdSerializercapable of serializing Spring CacheNullValueusing the given type property name. Please make sure to activedefault typingaccordingly.- Returns:
thisbuilder.
-
enableUnsafeDefaultTyping
@Contract("-> this") public GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B> enableUnsafeDefaultTyping()Enablesdefault typingwithout any type validation constraints.WARNING: without restrictions of the
PolymorphicTypeValidatordeserialization is vulnerable to arbitrary code execution when reading from untrusted sources.- Returns:
thisbuilder.- See Also:
-
enableDefaultTyping
@Contract("_ -> this") public GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B> enableDefaultTyping(tools.jackson.databind.jsontype.PolymorphicTypeValidator typeValidator) Enablesdefault typingusing the givenPolymorphicTypeValidator.- Returns:
thisbuilder.
-
typeValidator
@Contract("_ -> this") public GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<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.
-
typePropertyName
@Contract("_ -> this") public GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B> typePropertyName(String typePropertyName) Configure the type property name used for default typing andenableSpringCacheNullValueSupport().- Returns:
thisbuilder.
-
writer
@Contract("_ -> this") public GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B> writer(Jackson3ObjectWriter writer) Configures theJackson3ObjectWriter.- Parameters:
writer- must not be null.- Returns:
thisbuilder.
-
reader
@Contract("_ -> this") public GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B> reader(Jackson3ObjectReader reader) Configures theJackson3ObjectReader.- Parameters:
reader- must not be null.- Returns:
thisbuilder.
-
customize
@Contract("_ -> this") public GenericJackson3JsonRedisSerializer.GenericJackson3JsonRedisSerializerBuilder<B> customize(Consumer<B> mapperBuilderCustomizer) - Parameters:
mapperBuilderCustomizer- the configurer to apply to theObjectMapperbuilder.- Returns:
thisbuilder.
-
build
Build a newGenericJackson3JsonRedisSerializerinstance using the configured settings.- Returns:
- a new
GenericJackson3JsonRedisSerializerinstance.
-