Class StringRedisTemplate
java.lang.Object
org.springframework.data.redis.core.RedisAccessor
org.springframework.data.redis.core.RedisTemplate<String,String>
org.springframework.data.redis.core.StringRedisTemplate
- All Implemented Interfaces:
Aware, BeanClassLoaderAware, InitializingBean, RedisOperations<String,String>
String-focused extension of RedisTemplate. Since most operations against Redis are String based, this class provides
a dedicated class that minimizes configuration of its more generic
template especially in terms
of serializers.
Note that this template exposes the RedisConnection used by the RedisCallback as a
StringRedisConnection.
- Author:
- Costin Leau, Mark Paluch
-
Field Summary
Fields inherited from class RedisAccessor
logger -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newStringRedisTemplateinstance.StringRedisTemplate(RedisConnectionFactory connectionFactory) Constructs a newStringRedisTemplateinstance ready to be used. -
Method Summary
Methods inherited from class RedisTemplate
afterPropertiesSet, boundGeoOps, boundHashOps, boundListOps, boundSetOps, boundStreamOps, boundValueOps, boundZSetOps, convertAndSend, copy, countExistingKeys, createRedisConnectionProxy, delete, delete, discard, dump, exec, exec, execRaw, execute, execute, execute, execute, execute, execute, executePipelined, executePipelined, executePipelined, executePipelined, executeWithStickyConnection, expire, expire, expireAt, getClientList, getDefaultSerializer, getExpire, getExpire, getHashKeySerializer, getHashValueSerializer, getKeySerializer, getStringSerializer, getValueSerializer, hasKey, isEnableDefaultSerializer, isExposeConnection, keys, killClient, move, multi, opsForCluster, opsForGeo, opsForHash, opsForHyperLogLog, opsForList, opsForSet, opsForStream, opsForStream, opsForValue, opsForZSet, persist, postProcessResult, preProcessConnection, randomKey, rename, renameIfAbsent, replicaOf, replicaOfNoOne, restore, scan, setBeanClassLoader, setDefaultSerializer, setEnableDefaultSerializer, setEnableTransactionSupport, setExposeConnection, setHashKeySerializer, setHashValueSerializer, setKeySerializer, setScriptExecutor, setStringSerializer, setValueSerializer, sort, sort, sort, sort, sort, type, unlink, unlink, unwatch, watch, watchMethods inherited from class RedisAccessor
getConnectionFactory, getRequiredConnectionFactory, setConnectionFactoryMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RedisOperations
expiration, expire, expireAt, restore
-
Constructor Details
-
StringRedisTemplate
public StringRedisTemplate()Constructs a newStringRedisTemplateinstance.RedisAccessor.setConnectionFactory(RedisConnectionFactory)andRedisTemplate.afterPropertiesSet()still need to be called. -
StringRedisTemplate
Constructs a newStringRedisTemplateinstance ready to be used.- Parameters:
connectionFactory- connection factory for creating new connections
-