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
Modifier and TypeClassDescriptionstatic enum
Collection types supported by this factory. -
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Class<?>
boolean
void
setBeanName
(String name) void
Sets the key of the store.void
setTemplate
(RedisTemplate<String, ?> template) Sets the template used by the resulting store.void
Sets the store type.
-
Constructor Details
-
RedisCollectionFactoryBean
public RedisCollectionFactoryBean()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-
getObject
- Specified by:
getObject
in interfaceFactoryBean<RedisStore>
-
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<RedisStore>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceFactoryBean<RedisStore>
-
setBeanName
- Specified by:
setBeanName
in 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.
-