类 SetCache<T>

所有已实现的接口:
IBaseCache, IRedisCache, ISetCache<T>, IValueCache<T>, AutoCloseable
直接已知子类:
SetDbCache

public class SetCache<T> extends RedisCache implements ISetCache<T>
set 集合
  • 构造器详细资料

    • SetCache

      public SetCache(String node, String item, org.springframework.data.redis.connection.RedisConnection redisConnection, ICacheKey cacheKey, String prefix, Class<T> clazz) throws Exception
      SetCache
      参数:
      node - 缓存key配置db节点
      item - 缓存key配置项
      redisConnection - RedisConnection
      cacheKey - ICacheKey
      prefix - 缓存前缀
      clazz - T.class
      抛出:
      Exception
  • 方法详细资料

    • add

      public boolean add(T value, Object... args) throws Exception
      添加数据
      指定者:
      add 在接口中 ISetCache<T>
      参数:
      value -
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • add

      public long add(List<T> list, Object... args) throws Exception
      添加数据
      指定者:
      add 在接口中 ISetCache<T>
      参数:
      list - value list
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • get

      public List<T> get(Object... args) throws Exception
      获取集合
      指定者:
      get 在接口中 ISetCache<T>
      参数:
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • join

      public List<T> join(Object[] firstArgs, Object[] secondArgs, SetOp op) throws Exception
      两个集合运算,返回运算结果
      指定者:
      join 在接口中 ISetCache<T>
      参数:
      firstArgs - 第一个集合缓存key参数
      secondArgs - 第二集合缓存key参数
      op - 操作
      返回:
      抛出:
      Exception
    • joinAndAdd

      public long joinAndAdd(Object[] addArgs, Object[] firstArgs, Object[] secondArgs, SetOp op) throws Exception
      两个集合运算,并将运算结果存储到新集合
      指定者:
      joinAndAdd 在接口中 ISetCache<T>
      参数:
      addArgs - 新集合缓存key参数
      firstArgs - 第一个集合缓存key参数
      secondArgs - 第二集合缓存key参数
      op - 操作
      返回:
      抛出:
      Exception
    • exist

      public boolean exist(T value, Object... args) throws Exception
      value是否存在
      指定者:
      exist 在接口中 ISetCache<T>
      参数:
      value - value
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • getCount

      public long getCount(Object... args) throws Exception
      集合数量
      指定者:
      getCount 在接口中 ISetCache<T>
      参数:
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • move

      public boolean move(Object[] sourceArgs, Object[] desArgs, T value) throws Exception
      移动一个已存在对象到新集合
      指定者:
      move 在接口中 ISetCache<T>
      参数:
      sourceArgs - 源集合缓存key参数
      desArgs - 需要移到新集合缓存key参数
      value - 移动对象
      返回:
      抛出:
      Exception
    • pop

      public T pop(Object... args) throws Exception
      返回并移除一个集合对象
      指定者:
      pop 在接口中 ISetCache<T>
      参数:
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • pop

      public List<T> pop(int count, Object... args) throws Exception
      返回并移除集合对象
      指定者:
      pop 在接口中 ISetCache<T>
      参数:
      count - 数量
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • getRandomValue

      public T getRandomValue(Object... args) throws Exception
      随机返回一个对象
      指定者:
      getRandomValue 在接口中 ISetCache<T>
      参数:
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • getRandomValue

      public List<T> getRandomValue(int count, Object... args) throws Exception
      随机返回对象
      指定者:
      getRandomValue 在接口中 ISetCache<T>
      参数:
      count - 数量
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • delete

      public boolean delete(T value, Object... args) throws Exception
      移除对象
      指定者:
      delete 在接口中 ISetCache<T>
      参数:
      value - value
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • delete

      public long delete(List<T> list, Object... args) throws Exception
      移除对象
      指定者:
      delete 在接口中 ISetCache<T>
      参数:
      list - value list
      args - 缓存key参数
      返回:
      抛出:
      Exception
    • scan

      public ICacheCursor<T> scan(String pattern, int count, Object... args) throws Exception
      游标方式读取数据
      指定者:
      scan 在接口中 ISetCache<T>
      参数:
      pattern - 搜索表达式
      count - 游标页大小
      args - 缓存key参数
      返回:
      抛出:
      Exception