public class GenericJackson2JsonRedisSerializer extends Object implements org.springframework.data.redis.serializer.RedisSerializer<Object>
GenericJackson2JsonRedisSerializer
区别在于设置 DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);| 构造器和说明 |
|---|
GenericJackson2JsonRedisSerializer()
Creates
GenericJackson2JsonRedisSerializer and configures ObjectMapper for default typing. |
GenericJackson2JsonRedisSerializer(com.fasterxml.jackson.databind.ObjectMapper mapper)
Setting a custom-configured
ObjectMapper is one way to take further control of the JSON serialization
process. |
GenericJackson2JsonRedisSerializer(String classPropertyTypeName)
Creates
GenericJackson2JsonRedisSerializer and configures ObjectMapper for default typing using the
given name. |
public GenericJackson2JsonRedisSerializer()
GenericJackson2JsonRedisSerializer and configures ObjectMapper for default typing.public GenericJackson2JsonRedisSerializer(String classPropertyTypeName)
GenericJackson2JsonRedisSerializer and configures ObjectMapper for default typing using the
given name. In case of an empty or null String the default
JsonTypeInfo.Id#CLASS will be used.classPropertyTypeName - Name of the JSON property holding type information. Can be null.public GenericJackson2JsonRedisSerializer(com.fasterxml.jackson.databind.ObjectMapper mapper)
ObjectMapper is one way to take further control of the JSON serialization
process. For example, an extended SerializerFactory can be configured that provides custom serializers for
specific types.mapper - must not be null.public byte[] serialize(Object source) throws org.springframework.data.redis.serializer.SerializationException
serialize 在接口中 org.springframework.data.redis.serializer.RedisSerializer<Object>org.springframework.data.redis.serializer.SerializationExceptionpublic Object deserialize(byte[] source) throws org.springframework.data.redis.serializer.SerializationException
deserialize 在接口中 org.springframework.data.redis.serializer.RedisSerializer<Object>org.springframework.data.redis.serializer.SerializationExceptionpublic <T> T deserialize(byte[] source,
Class<T> type)
throws org.springframework.data.redis.serializer.SerializationException
org.springframework.data.redis.serializer.SerializationExceptionCopyright © 2018 Pivotal Software, Inc.. All rights reserved.