Class RedisHelper

java.lang.Object
net.ideahut.springboot.redis.RedisHelper

public final class RedisHelper extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.springframework.data.redis.connection.RedisConnectionFactory
    createRedisConnectionFactory(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
    deleteKey(org.springframework.data.redis.core.RedisTemplate<K,V> template, String prefix, K key)
     
    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
    getValue(org.springframework.data.redis.core.RedisTemplate<K,V> template, String prefix, K key)
     
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static <K, V> void setValue(org.springframework.data.redis.core.RedisTemplate<K,V> template, String prefix, K key, V value, long timeout, TimeUnit timeunit)
    • 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)