Module spring.data.redis
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 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<?>voidsetBeanName(String name) voidSets the key of the store.voidsetTemplate(RedisTemplate<String, ?> template) Sets the template used by the resulting store.voidSets the store type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBean
isSingletonMethods inherited from interface org.springframework.beans.factory.SmartFactoryBean
isEagerInit, isPrototype
-
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>
-
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.
-