Google Guava-基于泛型的使用方式
来源:互联网 发布:钢结构强度计算软件 编辑:程序博客网 时间:2024/06/09 19:34
源码:
private static Cache<String, String> cacheFormCallable = null;public static <K, V> Cache<K, V> callableCached() throws Exception {Cache<K, V> cache = CacheBuilder.newBuilder().maximumSize(10000).expireAfterWrite(10, TimeUnit.MINUTES).build();return cache;}private String getCallableCache(final String userName) {try {// Callable只有在缓存值不存在时,才会调用return cacheFormCallable.get(userName, new Callable<String>() {@Overridepublic String call() throws Exception {System.out.println(userName + " from db");return "hello " + userName + "!";}});} catch (ExecutionException e) {e.printStackTrace();return null;}}
0 0
- Google Guava-基于泛型的使用方式
- google guava的Preconditions使用
- Guava Objects类的使用方式【Guava学习笔记】
- google guava简单使用
- google guava使用介绍
- google Guava Cache使用
- google guava使用例子
- Google Guava 使用经验总结
- google 的guava学习
- Google Guava Collections 使用介绍
- Google Guava Collections 使用介绍
- Google Guava Collections 使用介绍
- Google Guava Collections 使用介绍
- Google Guava Collections 使用介绍
- Google Guava Collections 使用介绍
- Google Guava Collections 使用介绍
- Google Guava Collections 使用介绍
- Google Guava Collections 使用介绍
- Maven最佳实践:划分模块
- uva 12345 Dynamic len(set(a[L:R]))
- Dom4j 操作xml出现错误:Invalid byte 2 of 2-byte UTF-8 sequence.
- js获取元素高度、宽度
- 抗议式营销
- Google Guava-基于泛型的使用方式
- python matplotlib安装问题解决方案
- JAVA的文件操作【转】
- jave Duration: N/A, bitrate: N/A
- Go语言开发工具 LiteIDE X27 发布
- 软交所助力知识产权保护 促进软件产业创新发展
- java复习第十二课,api文档的阅读
- Shell 循环控制break/continue
- ADT中优化设置