Class DefaultRedisTypeMapper
java.lang.Object
org.springframework.data.convert.DefaultTypeMapper<Bucket.BucketPropertyPath>
org.springframework.data.redis.core.convert.DefaultRedisTypeMapper
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,TypeMapper<Bucket.BucketPropertyPath>
,RedisTypeMapper
public class DefaultRedisTypeMapper
extends 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
-
Constructor Summary
ConstructorDescriptionCreate a newDefaultRedisTypeMapper
usingDEFAULT_TYPE_KEY
to exchange type hints.DefaultRedisTypeMapper
(String typeKey) Create a newDefaultRedisTypeMapper
giventypeKey
to exchange type hints.DefaultRedisTypeMapper
(String typeKey, List<? extends TypeInformationMapper> mappers) Create a newDefaultRedisTypeMapper
giventypeKey
to exchange type hints andList
ofTypeInformationMapper
.DefaultRedisTypeMapper
(String typeKey, MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) -
Method Summary
Methods inherited from class org.springframework.data.convert.DefaultTypeMapper
getAliasFor, getFallbackTypeFor, readType, readType, setBeanClassLoader, writeType, writeType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 newDefaultRedisTypeMapper
usingDEFAULT_TYPE_KEY
to exchange type hints. -
DefaultRedisTypeMapper
Create a newDefaultRedisTypeMapper
giventypeKey
to exchange type hints. Does not consider type hints iftypeKey
is null.- Parameters:
typeKey
- the type key can be null to skip type hinting.
-
DefaultRedisTypeMapper
public DefaultRedisTypeMapper(@Nullable String typeKey, MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) Create a newDefaultRedisTypeMapper
giventypeKey
to exchange type hints andMappingContext
. Does not consider type hints iftypeKey
is null.MappingContext
is 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:
-
DefaultRedisTypeMapper
public DefaultRedisTypeMapper(@Nullable String typeKey, List<? extends TypeInformationMapper> mappers) Create a newDefaultRedisTypeMapper
giventypeKey
to exchange type hints andList
ofTypeInformationMapper
. Does not consider type hints iftypeKey
is null.MappingContext
is 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:RedisTypeMapper
Returns whether the givenkey
is the type key.- Specified by:
isTypeKey
in interfaceRedisTypeMapper
- Returns:
- true if the given
key
is the type key.
-