google guava工具包
guava这个工具包里有好多有用的工具类
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
//定时缓存
private com.google.common.cache.LoadingCache<String, AtomicInteger> failedCache =
com.google.common.cache.CacheBuilder.newBuilder()
.softValues()
.maximumSize(10000)
.build(new com.google.common.cache.CacheLoader<String, AtomicInteger>() {
@Override
public AtomicInteger load(String skuId) throws Exception {
return new AtomicInteger(0);
}
});
com.google.common.util.concurrent.RateLimiter rateLimiter = com.google.common.util.concurrent.RateLimiter.create(rate);
com.google.common.base.Splitter COMMA_SPLITTER = com.google.common.base.Splitter.on(“;”).trimResults().omitEmptyStrings();