Package net.ideahut.springboot.redis
Class RedisHelper
java.lang.Object
net.ideahut.springboot.redis.RedisHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.data.redis.connection.RedisConnectionFactorycreateRedisConnectionFactory(RedisProperties properties, boolean initialize) static <K,V> org.springframework.data.redis.core.RedisTemplate<K, V> createRedisTemplate(RedisProperties properties, boolean initialize) static <K,V> org.springframework.data.redis.core.RedisTemplate<K, V> createRedisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, boolean initialize) static <K,V> void static <K,V> void deleteKey(org.springframework.data.redis.core.RedisTemplate<K, V> template, K key) static <K,V> void deleteKeys(org.springframework.data.redis.core.RedisTemplate<K, V> template, String prefix, Collection<K> keys) static <K,V> void deleteKeys(org.springframework.data.redis.core.RedisTemplate<K, V> template, Collection<K> keys) static <K,V> V static <K,V> V getValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, K key) static <K,V> List<V> getValues(org.springframework.data.redis.core.RedisTemplate<K, V> template, String prefix, Collection<K> keys) static <K,V> List<V> getValues(org.springframework.data.redis.core.RedisTemplate<K, V> template, Collection<K> keys) static <K,V> void setValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, String prefix, K key, V value) static <K,V> void setValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, String prefix, K key, V value, long timeout, TimeUnit timeunit) static <K,V> void setValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, K key, V value) static <K,V> void setValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, K key, V value, long timeout, TimeUnit timeunit)
-
Method Details
-
createRedisConnectionFactory
public static org.springframework.data.redis.connection.RedisConnectionFactory createRedisConnectionFactory(RedisProperties properties, boolean initialize) throws Exception - Throws:
Exception
-
createRedisTemplate
public static <K,V> org.springframework.data.redis.core.RedisTemplate<K,V> createRedisTemplate(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, boolean initialize) -
createRedisTemplate
public static <K,V> org.springframework.data.redis.core.RedisTemplate<K,V> createRedisTemplate(RedisProperties properties, boolean initialize) throws Exception - Throws:
Exception
-
getValue
public static <K,V> V getValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, String prefix, K key) -
getValue
public static <K,V> V getValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, K key) -
setValue
-
setValue
public static <K,V> void setValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, K key, V value, long timeout, TimeUnit timeunit) -
setValue
public static <K,V> void setValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, String prefix, K key, V value) -
setValue
public static <K,V> void setValue(org.springframework.data.redis.core.RedisTemplate<K, V> template, K key, V value) -
getValues
public static <K,V> List<V> getValues(org.springframework.data.redis.core.RedisTemplate<K, V> template, String prefix, Collection<K> keys) -
getValues
public static <K,V> List<V> getValues(org.springframework.data.redis.core.RedisTemplate<K, V> template, Collection<K> keys) -
deleteKey
public static <K,V> void deleteKey(org.springframework.data.redis.core.RedisTemplate<K, V> template, String prefix, K key) -
deleteKey
public static <K,V> void deleteKey(org.springframework.data.redis.core.RedisTemplate<K, V> template, K key) -
deleteKeys
public static <K,V> void deleteKeys(org.springframework.data.redis.core.RedisTemplate<K, V> template, String prefix, Collection<K> keys) -
deleteKeys
public static <K,V> void deleteKeys(org.springframework.data.redis.core.RedisTemplate<K, V> template, Collection<K> keys)
-