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 Details

  • Constructor Details

    • DefaultRedisTypeMapper

      public DefaultRedisTypeMapper()
      Create a new DefaultRedisTypeMapper using DEFAULT_TYPE_KEY to exchange type hints.
    • DefaultRedisTypeMapper

      public DefaultRedisTypeMapper(@Nullable String typeKey)
      Create a new DefaultRedisTypeMapper given typeKey to exchange type hints. Does not consider type hints if typeKey is 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 new DefaultRedisTypeMapper given typeKey to exchange type hints and MappingContext. Does not consider type hints if typeKey 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:
      • TypeAlias
    • DefaultRedisTypeMapper

      public DefaultRedisTypeMapper(@Nullable String typeKey, List<? extends org.springframework.data.convert.TypeInformationMapper> mappers)
      Create a new DefaultRedisTypeMapper given typeKey to exchange type hints and List of TypeInformationMapper. Does not consider type hints if typeKey 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

      public boolean isTypeKey(@Nullable String key)
      Description copied from interface: RedisTypeMapper
      Returns whether the given key is the type key.
      Specified by:
      isTypeKey in interface RedisTypeMapper
      Returns:
      true if the given key is the type key.