google的cache缓存
Cache<String,String> cache = CacheBuilder.newBuilder() .maximumSize(50000) .expireAfterWrite(1, TimeUnit.DAYS) .build(); cache.put("abc", "123456"); System.out.println("-------" + cache.getIfPresent("abc")); cache.put("abc", "1234567890"); System.out.println("-------" + cache.getIfPresent("abc")); cache.invalidateAll(); System.out.println("-------" + cache.getIfPresent("abc"));