Class RedisCollectionFactoryBean
java.lang.Object
org.springframework.data.redis.support.collections.RedisCollectionFactoryBean
- All Implemented Interfaces:
Aware
,BeanNameAware
,FactoryBean<RedisStore>
,InitializingBean
,SmartFactoryBean<RedisStore>
public class RedisCollectionFactoryBean
extends Object
implements SmartFactoryBean<RedisStore>, BeanNameAware, InitializingBean
Factory bean that facilitates creation of Redis-based collections. Supports list, set, zset (or sortedSet), map (or
hash) and properties. Uses the key and
RedisCollectionFactoryBean.CollectionType
to determine what collection type to use. The factory
verifies the key type if a RedisCollectionFactoryBean.CollectionType
is specified. Defaults to RedisCollectionFactoryBean.CollectionType.LIST
.- Author:
- Costin Leau, Christoph Strobl, Mark Paluch
- See Also:
-
Nested Class Summary
Nested ClassesModifier 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Class<?>
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
Methods inherited from interface org.springframework.beans.factory.SmartFactoryBean
isEagerInit, isPrototype
-
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>
-
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.
-