Class RedisCollectionFactoryBean
java.lang.Object
org.springframework.data.redis.support.collections.RedisCollectionFactoryBean
- All Implemented Interfaces:
Aware,BeanNameAware,FactoryBean<RedisStore>,InitializingBean
public class RedisCollectionFactoryBean
extends Object
implements InitializingBean, BeanNameAware, 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCollection types supported by this factory. -
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClass<?>booleanvoidsetBeanName(String name) voidSets the key of the store.voidsetTemplate(RedisTemplate<String, ?> template) Sets the template used by the resulting store.voidSets the store type.
-
Constructor Details
-
RedisCollectionFactoryBean
public RedisCollectionFactoryBean()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean
-
getObject
- Specified by:
getObjectin interfaceFactoryBean<RedisStore>
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<RedisStore>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceFactoryBean<RedisStore>
-
setBeanName
- Specified by:
setBeanNamein interfaceBeanNameAware
-
setType
Sets the store type. Used if the key does not exist.- Parameters:
type- The type to set.
-
setTemplate
Sets the template used by the resulting store.- Parameters:
template- The template to set.
-
setKey
Sets the key of the store.- Parameters:
key- The key to set.
-