标签:builder rac group ref utf-8 guava cache over com
<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>18.0</version> </dependency>
LoadingCache<String, String> cache = CacheBuilder.newBuilder() .maximumSize(1000) .expireAfterAccess(3, TimeUnit.SECONDS) .refreshAfterWrite(1, TimeUnit.SECONDS) .build(new CacheLoader<String, String>() { @Override public String load(String s) throws Exception { return s + "cache"; } }); String sss = cache.getUnchecked("sss");
<properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <encoding>UTF-8</encoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties>
标签:builder rac group ref utf-8 guava cache over com
原文地址:http://www.cnblogs.com/zhshlimi/p/6434446.html