0

我正在学习咖啡因。在这段代码中:

public Map<String, Object> getDicTree() {
    // CacheUtil is a self-defined method
    if (!CacheUtil.isCacheExpired("c1")) {
      return cacheUtil.getCache("c1");
    }

    HashMap<String, Object> map = Maps.newHashMap();
    map.put("1", "one");
    map.put("2", "two");
    // c1 is cache's name, 1 is key, one is value
    CacheUtil.putValue("c1", "1", "one");
    CacheUtil.putValue("c1", "2", "two");
    

    return map;
  }

如何实现该isCacheExpired方法?

4

0 回答 0