Apache容器扩展Transformer类
来源:互联网 发布:苹果二手 淘宝 编辑:程序博客网 时间:2024/05/29 19:25
1)CollectionUtils.collect() 工具类
2)SwitchTransformer() 选择类。要注意一下Predicate[] 和 Transformer[]参数传递的问题
public static void main(String[] args) {// 转换规则Transformer<Long, String> trans = new Transformer<Long, String>() {@Overridepublic String transform(Long input) {return new SimpleDateFormat("yyyy-MM-dd hh-mm-ss").format(input);}};// 容器Set<Long> set = new HashSet<Long>();set.add(123456789L);set.add(1234323232323L);set.add(32453253453245L);// 开始转换Collection<String> result = CollectionUtils.collect(set, trans);// 遍历容器Iterator<String> iter = result.iterator();while (iter.hasNext()) {System.out.println(iter.next());}}}/*Output:1970-01-02 06-17-362998-05-27 04-37-332009-02-11 11-33-52*/
0 0
- Apache容器扩展Transformer类
- Apache容器扩展类和常用方法
- org.apache.commons扩展容器中的Predicate类
- Transformer
- Spring容器扩展点-PropertyPlaceholderConfigurer类
- Spring容器扩展--PropertyPlaceholderConfigurer
- 容器扩展点
- java容器---Map扩展
- 容器的扩展-1
- 容器的扩展-2
- spring扩展容器-ApplicationContext
- Laravel & Lumen RESTFul API 扩展包:Dingo API(五) —— 转化器(Transformer)
- apxs - Apache 扩展工具
- apache proxy扩展安装
- apxs - Apache 扩展工具
- apxs - Apache 扩展工具
- apache上传扩展
- apxs - Apache 扩展工具
- NSDictionary以及NSMutableDictionary用法总结
- 黑马程序员-----Collection集合
- 数据库的范式,第一、二、三、四、五范式、BC范式,为什么分不清
- Sublime Text 搭建 Python 开发平台
- 区别[[UIScreen mainScreen] bounds] 和 [[UIScreen mainScreen] applicationFrame]
- Apache容器扩展Transformer类
- C#泛型特性总结
- RabbitMQ集群
- kill命令
- IOS对象关系映射(ORM)之coreData框架的学习——(二)原理剖析及使用步骤详解
- 黑马程序员-----Map双列集合
- HDU 5480 Conturbatio(前缀和)
- 十四、ContentProvider往通讯录添加联系人和获取联系人
- 十五、从互联网获取图片且保存到指定目录