Class DefaultRedisTypeMapper
java.lang.Object
org.springframework.data.convert.DefaultTypeMapper<Bucket.BucketPropertyPath>
org.springframework.data.redis.core.convert.DefaultRedisTypeMapper
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.data.convert.TypeMapper<Bucket.BucketPropertyPath>,RedisTypeMapper
public class DefaultRedisTypeMapper
extends org.springframework.data.convert.DefaultTypeMapper<Bucket.BucketPropertyPath>
implements RedisTypeMapper
Default implementation of
RedisTypeMapper allowing configuration of the key to lookup and store type
information via Bucket.BucketPropertyPath in buckets. The key defaults to DEFAULT_TYPE_KEY. Actual
type-to-byte[] conversion and back is done in DefaultRedisTypeMapper.BucketTypeAliasAccessor.- Since:
- 2.1
- Author:
- Mark Paluch
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newDefaultRedisTypeMapperusingDEFAULT_TYPE_KEYto exchange type hints.DefaultRedisTypeMapper(String typeKey) Create a newDefaultRedisTypeMappergiventypeKeyto exchange type hints.DefaultRedisTypeMapper(String typeKey, List<? extends org.springframework.data.convert.TypeInformationMapper> mappers) Create a newDefaultRedisTypeMappergiventypeKeyto exchange type hints andListofTypeInformationMapper.DefaultRedisTypeMapper(String typeKey, org.springframework.data.mapping.context.MappingContext<? extends org.springframework.data.mapping.PersistentEntity<?, ?>, ?> mappingContext) -
Method Summary
Methods inherited from class org.springframework.data.convert.DefaultTypeMapper
getAliasFor, getFallbackTypeFor, readType, readType, setBeanClassLoader, writeType, writeTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.convert.TypeMapper
readType, readType, writeType, writeType
-
Field Details
-
DEFAULT_TYPE_KEY
- See Also:
-
-
Constructor Details
-
DefaultRedisTypeMapper
public DefaultRedisTypeMapper()Create a newDefaultRedisTypeMapperusingDEFAULT_TYPE_KEYto exchange type hints. -
DefaultRedisTypeMapper
Create a newDefaultRedisTypeMappergiventypeKeyto exchange type hints. Does not consider type hints iftypeKeyis null.- Parameters:
typeKey- the type key can be null to skip type hinting.
-
DefaultRedisTypeMapper
public DefaultRedisTypeMapper(@Nullable String typeKey, org.springframework.data.mapping.context.MappingContext<? extends org.springframework.data.mapping.PersistentEntity<?, ?>, ?> mappingContext) Create a newDefaultRedisTypeMappergiventypeKeyto exchange type hints andMappingContext. Does not consider type hints iftypeKeyis null.MappingContextis used to obtain entity-based aliases- Parameters:
typeKey- the type key can be null to skip type hinting.mappingContext- must not be null.- See Also:
-
TypeAlias
-
DefaultRedisTypeMapper
public DefaultRedisTypeMapper(@Nullable String typeKey, List<? extends org.springframework.data.convert.TypeInformationMapper> mappers) Create a newDefaultRedisTypeMappergiventypeKeyto exchange type hints andListofTypeInformationMapper. Does not consider type hints iftypeKeyis null.MappingContextis used to obtain entity-based aliases- Parameters:
typeKey- the type key can be null to skip type hinting.mappers- must not be null.
-
-
Method Details
-
isTypeKey
Description copied from interface:RedisTypeMapperReturns whether the givenkeyis the type key.- Specified by:
isTypeKeyin interfaceRedisTypeMapper- Returns:
- true if the given
keyis the type key.
-