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. form modelform formset modelformset的各种用法

    form modelform formset modelformset的各种用法   首先上结论: form适用于对单个表单的操作,并且需要对每个字段的验证规则自定义. modelform:适用于对用 ...

  2. Redis客户端信息的存取

    字符串的存: set name xxx 字符串的取: get name Hashes的存: HMSET xxx xxx xxx Hashes的取: HGETALL xxx Lists的存: lpush ...

  3. 关于session的一些问题

    最近在做项目的时候碰见了session过期的问题,然后就上网查了一些资料,我将我整理过的知识点梳理一下,顺便说一下我的使用方案. Session存储在服务器端,一般为了防止在服务器的内存中(为了高速存 ...

  4. 【神经网络与深度学习】【C/C++】ZLIB学习2

    Zlib文件压缩和解压 开源代码:http://www.zlib.net/ zlib使用手册:http://www.zlib.net/manual.html zlib wince版:http://ww ...

  5. 包含时间的Json序列化

    public static string ObjectToJson<T>(T t) { using (MemoryStream ms = new MemoryStream()) { Dat ...

  6. 登录进入Mysql数据库的几种方式

    前提:连接进入mysql数据库 本机安装的myslq基础信息: host= "localhost", # 数据库主机地址:127.0.0.1 port=3306, # 端口号 us ...

  7. C# async await的使用

    async 声明一个包含异步代码的函数,该函数执行时不会阻塞调用线程. async标记的函数返回值必须为 void ,Task,Task<TResult> await 必须修饰Task 或 ...

  8. MHA搭建

    https://metacpan.org 下载perl依赖包的网站 ##################上传安装依赖包#################### mkdir /opt/soft_file ...

  9. C++多线程基础学习笔记(三)

    一.detach()大坑 上一篇随笔(二)中提到detach()是用来分离主线程和子线程的,那么需要考虑一个问题,就是如果主线程跑完了,主线程中定义的变量就会被销毁(释放内存),这时回收变量仍作为参数 ...

  10. 从入门到自闭之Python时间模块

    time模块:import time time.time():时间戳,是一个浮点数,按秒来计算 time.sleep():睡眠,程序暂停多少秒执行 python中时间日期格式化符号: 必背 %y 两位 ...