Class RedisCollectionFactoryBean

java.lang.Object
org.springframework.data.redis.support.collections.RedisCollectionFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<RedisStore>, org.springframework.beans.factory.InitializingBean

public class RedisCollectionFactoryBean extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<RedisStore>
Factory bean that facilitates creation of Redis-based collections. Supports list, set, zset (or sortedSet), map (or hash) and properties. Will use the key type if it exists or to create a dedicated collection (Properties vs Map). Otherwise uses the provided type (default is list).
Author:
Costin Leau
  • Constructor Details

    • RedisCollectionFactoryBean

      public RedisCollectionFactoryBean()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • getObject

      public RedisStore getObject()
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<RedisStore>
    • getObjectType

      public Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<RedisStore>
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface org.springframework.beans.factory.FactoryBean<RedisStore>
    • setBeanName

      public void setBeanName(String name)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • setType

      public void setType(RedisCollectionFactoryBean.CollectionType type)
      Sets the store type. Used if the key does not exist.
      Parameters:
      type - The type to set.
    • setTemplate

      public void setTemplate(RedisTemplate<String,?> template)
      Sets the template used by the resulting store.
      Parameters:
      template - The template to set.
    • setKey

      public void setKey(String key)
      Sets the key of the store.
      Parameters:
      key - The key to set.