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. django helloworld

    http://note.youdao.com/noteshare?id=8f0b036922e71c1feb5d0d06a4779c6f

  2. phpstorm 远程连接服务器进行开发

    phpstorm phpstorm是一款功能强大的ide编辑器,有了它,你敲代码速度能比用notepad++快数倍(初学者不建议使用ide,建议使用notepad++),缺点是没有固态的电脑带起来吃力 ...

  3. JS创建对象的四种简单方式 (工厂模式和自定义构造函数创建对象的区别)

    // 对象:特指的某个事物,具有属性和方法(一组无序的属性的集合) // 特征------>属性 // 行为------>方法 // 创建对象的四种方式 1 // 1.字面量的方式,就是实 ...

  4. CornerNet 算法笔记

    论文名称:CornerNet: Detecting Objects as Paired Keypoints 论文链接:https://arxiv.org/abs/1808.01244 代码链接:htt ...

  5. sqlalchemy一对一关系映射

    #encoding: utf-8 from sqlalchemy import create_engine,Column,Integer,String,Float,func,and_,or_,Text ...

  6. PTA(Basic Level)1027.打印沙漏

    本题要求你写个程序把给定的符号打印成沙漏的形状.例如给定17个"*",要求按下列格式打印 ***** *** * *** ***** 所谓"沙漏形状",是指每行 ...

  7. python list 中extend()与append()区别

    def changextend(str): "print string with extend" mylist.extend([40,50,60]); print(mylist) ...

  8. 300英雄的危机(heroes)

    题面 正解与图书馆馆长的考验一致,都是分层图SPFA: #include <iostream> #include <cstdio> #include <cstring&g ...

  9. # 丢包&&掉帧&&文件删除

    丢包&&掉帧&&文件删除 丢包:指一个或多个数据包(packet)的数据无法透过网络到达目的地,丢失一些信息 掉帧:帧数就是在1秒钟时间里传输的图片的量,每一帧都是静止 ...

  10. [NAIPC2016]Jewel Thief(决策单调性+分治)

    [NAIPC2016]Jewel Thief(决策单调性+分治) 题面 原题提交地址(题目编号H) 原题面下载地址 有\(n\)个物品,每个物品有一个体积\(w_i\)和价值\(v_i\),现在要求对 ...