随笔分类 - guava
摘要:转自 https://blog.csdn.net/qq_34231010/article/details/82530368 一、集合工具1.Lists List<Integer> list1 = Lists.newArrayList(0, 2, 5);List<Integer> list2 = Li
阅读全文
摘要:Guava Cache是在内存中缓存数据,相比较于数据库或redis存储,访问内存中的数据会更加高效。Guava官网介绍,下面的这几种情况可以考虑使用Guava Cache: 愿意消耗一些内存空间来提升速度。 预料到某些键会被多次查询。 缓存中存放的数据总量不会超出内存容量。 所以,可以将程序频繁用
阅读全文
摘要:1.问题提出 1.前段时间在项目中用到Lists.transform返回的List,在对该list修改后发现修改并没有反映在结果里,研究源码后发现问题还挺大。下面通过单步调试的结果来查看Guava Lists.transform使用过程中需要注意的地方。 a.对原有的list列表修改会影响Lists
阅读全文
摘要:1 import static org.junit.Assert.*; 2 3 import java.util.List; 4 import java.util.Map; 5 6 import org.junit.Test; 7 8 import com.google.co...
阅读全文
摘要:参考:http://codemunchies.com/2009/10/beautiful-code-with-google-collections-guava-and-static-imports-part-1/(2,3,4)http://blog.publicobject.com更多用法参考htt...
阅读全文