Class GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<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.GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<B>
- Type Parameters:
B- type of theMapperBuilder.
- Enclosing class:
- GenericJacksonJsonRedisSerializer
public static class GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<B extends tools.jackson.databind.cfg.MapperBuilder<? extends tools.jackson.databind.ObjectMapper,? extends tools.jackson.databind.cfg.MapperBuilder<?,?>>>
extends Object
GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder wraps around a JsonMapper.Builder providing dedicated
methods to configure aspects like NullValue serialization strategy for the resulting ObjectMapper
to be used with GenericJacksonJsonRedisSerializer as well as potential Object/-reader and -writer settings.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a newGenericJacksonJsonRedisSerializerinstance 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(JacksonObjectReader reader) Configures theJacksonObjectReader.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(JacksonObjectWriter writer) Configures theJacksonObjectWriter.
-
Method Details
-
enableSpringCacheNullValueSupport
@Contract("-> this") public GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<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 GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<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 GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<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 GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<B> enableDefaultTyping(tools.jackson.databind.jsontype.PolymorphicTypeValidator typeValidator) Enablesdefault typingusing the givenPolymorphicTypeValidator.- Returns:
thisbuilder.
-
typeValidator
@Contract("_ -> this") public GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<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 GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<B> typePropertyName(String typePropertyName) Configure the type property name used for default typing andenableSpringCacheNullValueSupport().- Returns:
thisbuilder.
-
writer
@Contract("_ -> this") public GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<B> writer(JacksonObjectWriter writer) Configures theJacksonObjectWriter.- Parameters:
writer- must not be null.- Returns:
thisbuilder.
-
reader
@Contract("_ -> this") public GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<B> reader(JacksonObjectReader reader) Configures theJacksonObjectReader.- Parameters:
reader- must not be null.- Returns:
thisbuilder.
-
customize
@Contract("_ -> this") public GenericJacksonJsonRedisSerializer.GenericJacksonJsonRedisSerializerBuilder<B> customize(Consumer<B> mapperBuilderCustomizer) - Parameters:
mapperBuilderCustomizer- the configurer to apply to theObjectMapperbuilder.- Returns:
thisbuilder.
-
build
Build a newGenericJacksonJsonRedisSerializerinstance using the configured settings.- Returns:
- a new
GenericJacksonJsonRedisSerializerinstance.
-