类 CaffeineCache

java.lang.Object
net.oschina.j2cache.caffeine.CaffeineCache
所有已实现的接口:
Cache, Level1Cache

public class CaffeineCache extends Object implements Level1Cache
Caffeine cache
作者:
Winter Lau(javayou@gmail.com)
  • 构造器详细资料

    • CaffeineCache

      public CaffeineCache(com.github.benmanes.caffeine.cache.Cache<String,Object> cache, long size, long expire)
  • 方法详细资料

    • ttl

      public long ttl()
      从接口复制的说明: Level1Cache
      返回该缓存区域的 TTL 设置(单位:秒)
      指定者:
      ttl 在接口中 Level1Cache
      返回:
      true if cache support ttl setting
    • size

      public long size()
      从接口复制的说明: Level1Cache
      返回该缓存区域中,内存存储对象的最大数量
      指定者:
      size 在接口中 Level1Cache
      返回:
      cache size in memory
    • get

      public Object get(String key)
      从接口复制的说明: Cache
      Get an item from the cache, nontransactionally
      指定者:
      get 在接口中 Cache
      参数:
      key - cache key
      返回:
      the cached object or null
    • get

      public Map<String,Object> get(Collection<String> keys)
      从接口复制的说明: Cache
      批量获取缓存对象
      指定者:
      get 在接口中 Cache
      参数:
      keys - cache keys
      返回:
      return key-value objects
    • put

      public void put(String key, Object value)
      从接口复制的说明: Cache
      Add an item to the cache, nontransactionally, with failfast semantics
      指定者:
      put 在接口中 Cache
      参数:
      key - cache key
      value - cache value
    • put

      public void put(Map<String,Object> elements)
      从接口复制的说明: Cache
      批量插入数据
      指定者:
      put 在接口中 Cache
      参数:
      elements - objects to be put in cache
    • keys

      public Collection<String> keys()
      从接口复制的说明: Cache
      Return all keys
      指定者:
      keys 在接口中 Cache
      返回:
      返回键的集合
    • evict

      public void evict(String... keys)
      从接口复制的说明: Cache
      Remove items from the cache
      指定者:
      evict 在接口中 Cache
      参数:
      keys - Cache key
    • clear

      public void clear()
      从接口复制的说明: Cache
      Clear the cache
      指定者:
      clear 在接口中 Cache