guava这个工具包里有好多有用的工具类

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>${guava.version}</version>
</dependency>
com.google.common.base.Objects.firstNonNull(jimDB.get(lockKey), "0")  返回第一个非空元素,如果第一个非空,就返回第一个元素,否则就继续判断第二个元素,第二个不为空,就返回第二个,第二个也为空,就抛出异常
Map<String, String> result = com.google.common.collect.Maps.newHashMap();
 
Set<StringRedisTemplate> canExpireRedisTemplateSet = com.google.common.collect.Sets.newHashSet()
 

//定时缓存

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();

 
com.google.common.base.Strings.isNullOrEmpty(referer)   //判断是否为空
 
 

google guava工具包的更多相关文章

  1. 有关google的guava工具包详细说明

    Guava 中文是石榴的意思,该项目是 Google 的一个开源项目,包含许多 Google 核心的 Java 常用库. 目前主要包含: com.google.common.annotations c ...

  2. 【转载】使用 Google Guava 美化你的 Java 代码

    转载地址: https://blog.csdn.net/wisgood/article/details/13297535 原文地址:https://my.oschina.net/leejun2005/ ...

  3. Google Guava 类库简介

    Guava 是一个 Google开发的 基于java的类库集合的扩展项目,包括 collections, caching, primitives support, concurrency librar ...

  4. java开发人员,最应该学习和熟练使用的工具类。google guava.(谷歌 瓜娃)

    学习参考文章: http://blog.csdn.net/wisgood/article/details/13297535 http://ifeve.com/google-guava/ http:// ...

  5. [转]Google Guava官方教程(中文版)

    Google Guava官方教程(中文版) http://ifeve.com/google-guava/

  6. Google Guava官方教程(中文版)

    Google Guava官方教程(中文版) 原文链接  译文链接 译者: 沈义扬,罗立树,何一昕,武祖  校对:方腾飞 引言 Guava工程包含了若干被Google的 Java项目广泛依赖 的核心库, ...

  7. Google Guava vs Apache Commons for Argument Validation

    It is an established good practice to validate method arguments at the beginning of the method body. ...

  8. 使用 Google Guava 美化你的 Java 代码

    文章转载自:http://my.oschina.net/leejun2005/blog/172328 目录:[ - ] 1-使用 GOOGLE COLLECTIONS,GUAVA,STATIC IMP ...

  9. Google Guava之--cache

    一.简介 Google Guava包含了Google的Java项目许多依赖的库,如:集合 [collections] .缓存 [caching] .原生类型支持 [primitives support ...

随机推荐

  1. (“(null)” is of a model that is not supported by this version of Xcode. Please...)

    真机测试遇到以下问题: (还以为手机不支持Xcode的版本呢) 解决方法: 发现只要将XCode重启后就可以真机运行了,碰见这个问题的朋友可以试下,我反正是被坑了半小时...

  2. ansible加速不管用

    ansible加速 试过不管用,反而更慢 cat > /root/.ssh/config <<EOF Host * Compression yes ServerAliveInterv ...

  3. Beego框架的一条神秘日志引发的思考

    公司目前的后台是用Beego框架搭的,并且为了服务的不中断升级,我们开启了Beego的Grace模块,用于热升级支持.一切都跑井然有序,直到有一天,领导甩出一些服务日志,告知程序一直报错: 2018/ ...

  4. 论文阅读 | BadNets: Identifying Vulnerabilities in the Machine Learning Model Supply Chain

    BadNets: 识别机器学习模型供应链中的漏洞 摘要 基于深度学习的技术已经在各种各样的识别和分类任务上取得了最先进的性能.然而,这些网络通常训练起来非常昂贵,需要在许多gpu上进行数周的计算;因此 ...

  5. 记录Linq中lambda动态表达式的使用方式

    项目中有的时候我们会用到动态表达式的方式去查询数据,这里简单记录下个人的使用方式,方便使用↓ //构建参数表达式 ParameterExpression parameter = Expression. ...

  6. [转帖]Linux性能测试 pmap命令

    Linux性能测试 pmap命令 https://www.cnblogs.com/txw1958/archive/2012/07/26/linux-pmap.html 名称:       pmap - ...

  7. 转-性能优化中CPU、内存、磁盘IO、网络性能的依赖

    转自:https://www.cnblogs.com/Javame/p/3665565.html 系统优化是一项复杂.繁琐.长期的工作,优化前需要监测.采集.测试.评估,优化后也需要测试.采集.评估. ...

  8. 阿里云对象存储OSS

    阿里云的产品种类繁多,今天让我们一起来了解下对象存储(Object Storage Service,简称OSS)吧! 什么是对象存储呢? 简单来说,对象存储OSS是阿里云提供的海量.安全和高可靠的云存 ...

  9. P3376 网络流-最大流模板题(Dinic+当前弧优化)

    (点击此处查看原题) Dinic算法 Dinic算法相对于EK算法,主要区别在于Dinic算法对图实现了分层,使得我们可以用一次bfs,一次dfs使得多条增广路得到增广 普通的Dinic算法已经可以处 ...

  10. Ruby学习中(条件判断, 循环, 异常处理)

    一. 条件判断 详情参看:https://www.runoob.com/ruby/ruby-decision.html 1.详情实例(看看就中了) #---------------# # LOL场均人 ...