类 AbstractStringRedisCache

java.lang.Object
cn.herodotus.engine.cache.redis.definition.AbstractStringRedisCache
所有已实现的接口:
StringRedisCache, org.springframework.beans.factory.InitializingBean

public abstract class AbstractStringRedisCache extends Object implements StringRedisCache

Description: SimpleRedisCache的基础实现

增加这一层是为了方便扩展,比如说支持JustAuth

作者:
: gengwei.zheng
Date:
: 2021/5/21 23:45
  • 构造器详细资料

    • AbstractStringRedisCache

      public AbstractStringRedisCache()
  • 方法详细资料

    • setStringRedisTemplate

      public void setStringRedisTemplate(org.springframework.data.redis.core.StringRedisTemplate stringRedisTemplate)
    • setPrefix

      public void setPrefix(String prefix)
    • setDefaultTimeout

      public void setDefaultTimeout(long defaultTimeout)
    • cache

      public void cache(String key, String value)
      从接口复制的说明: StringRedisCache
      存入缓存
      指定者:
      cache 在接口中 StringRedisCache
      参数:
      key - 缓存key
      value - 缓存内容
    • cache

      public void cache(String key, String value, long timeout)
      存入缓存
      指定者:
      cache 在接口中 StringRedisCache
      参数:
      key - 缓存key
      value - 缓存内容
      timeout - 指定缓存过期时间(毫秒)
    • get

      public String get(String key)
      获取缓存内容
      指定者:
      get 在接口中 StringRedisCache
      参数:
      key - 缓存key
      返回:
      缓存内容
    • containsKey

      public boolean containsKey(String key)
      是否存在key,如果对应key的value值已过期,也返回false
      指定者:
      containsKey 在接口中 StringRedisCache
      参数:
      key - 缓存key
      返回:
      true:存在key,并且value没过期;false:key不存在或者已过期
    • delete

      public boolean delete(String key)
      指定者:
      delete 在接口中 StringRedisCache