Interface CacheX

All Known Implementing Classes:
EhCache, GuavaCache, MemcachedCache, MemoryCache, NoOpCache, RedisCache, RedisClusterCache

public interface CacheX
缓存接口
Since:
Java 17+
Author:
Kimi Liu
  • Method Details

    • read

      Object read(String key)
      从缓存中获得对象
      Parameters:
      key - 键
      Returns:
      键对应的对象
      See Also:
    • read

      从缓存中获得一组对象信息
      Parameters:
      keys - 多个键
      Returns:
      值对象
    • write

      void write(String key, Object value, long expire)
      将对象加入到缓存,使用指定失效时长
      Parameters:
      key - 键
      value - 缓存的对象
      expire - 失效时长,单位毫秒
      See Also:
    • write

      void write(Map<String,Object> map, long expire)
      将对象加入到缓存,使用指定失效时长
      Parameters:
      map - 缓存的对象
      expire - 失效时长,单位毫秒
      See Also:
    • remove

      void remove(String... keys)
      从缓存中移除对象
      Parameters:
      keys - 键
    • clear

      void clear()
      清空缓存信息