接口 Cache

所有已知子接口:
Level1Cache, Level2Cache
所有已知实现类:
CaffeineCache, EhCache, EhCache3, LettuceCache, LettuceGenericCache, LettuceHashCache, MemCache, NullCache, RedisGenericCache, RedisHashCache

public interface Cache
Cache Data Operation Interface
作者:
Winter Lau(javayou@gmail.com)
  • 方法详细资料

    • get

      Object get(String key)
      Get an item from the cache, nontransactionally
      参数:
      key - cache key
      返回:
      the cached object or null
    • get

      批量获取缓存对象
      参数:
      keys - cache keys
      返回:
      return key-value objects
    • exists

      default boolean exists(String key)
      判断缓存是否存在
      参数:
      key - cache key
      返回:
      true if key exists
    • put

      void put(String key, Object value)
      Add an item to the cache, nontransactionally, with failfast semantics
      参数:
      key - cache key
      value - cache value
    • put

      void put(Map<String,Object> elements)
      批量插入数据
      参数:
      elements - objects to be put in cache
    • keys

      Return all keys
      返回:
      返回键的集合
    • evict

      void evict(String... keys)
      Remove items from the cache
      参数:
      keys - Cache key
    • clear

      void clear()
      Clear the cache