apache commons(瑞士军刀)
来源:互联网 发布:矩阵的拉普拉斯变换 编辑:程序博客网 时间:2024/06/15 11:42
概述
有熟悉的架构师曾说过,apache commons提供的功能也需要牢记,这就相当于军人的瑞士军刀,小巧、方便、好用。
这里罗列两个常用到的lang3和collection4。总的来说,随着jdk的版本不断提高,瑞士军刀的功能也在逐渐的被弱化,很多内容已经被jdk吸收。虽然如此,在日常里面还是会用到一些常用的方法,这里进行简单列举。
commons-collections4
MapUtils
isEmpty|isNotEmpty(判空)
getString|Boolean|Number|Byte|Short|Integer|Long|Float|Double(取值,包含有默认值|无默认值两类方法)
CollectionUtils
isEmpty|isNotEmpty(判空)
retainAll(保留两者的交集,效率是O(n^2)的)
intersection(交集)
disjunction(差集)
commons-lang3
StringUtils
isEmpty(判空)
isNotBlank(判空)
join(拼接数组)
leftPad(补齐到指定宽度)
startsWith(是否以字符串开始)
isNumeric(是不是数字,不判断小数点)
RandomStringUtils
(这个类没有很常用,以下引自博客:http://787141854-qq-com.iteye.com/blog/2068616)
random(5, new char[] { ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘1’, ‘2’, ‘3’ }); (使用指定的字符生成5位长度的随机字符串)
randomAlphanumeric(生成指定长度的字母和数字的随机组合字符串)
randomNumeric(生成随机数字字符串)
randomAlphabetic(生成随机[a-z]字符串,包含大小写 )
randomAscii(生成从ASCII 32到126组成的随机字符串 )
- apache commons(瑞士军刀)
- Apache Commons(http://commons.apache.org/)
- Apache Commons 总结- (Jakarta Commons)-总览
- Apache Commons
- APACHE COMMONS
- Apache Commons
- Apache Commons
- apache.commons
- Apache commons
- apache commons
- Apache Commons
- Apache Commons
- Apache Commons
- Apache Commons工具集简介(二)
- FTP上传下载(Apache Commons Net)
- apache-commons常用技术(一)
- Apache Commons Email的使用(一)
- apache commons StringUtils介绍 (转)
- CentOS高性能缓存服务器Squid架构配置
- 【Android开发】Toolbar与返回按钮
- 2017年一年的规划
- 动画介绍
- LQ BASIC-11 十六进制转十进制
- apache commons(瑞士军刀)
- Apple Developer Program注册设备满了100台,如何移除?
- HighCharts API文档
- 梯度下降法的三种形式BGD、SGD以及MBGD
- Android Studio彻底断开SVN
- Nginx+tomcat负载均衡缓存服务器集群
- java详解浅复制和深复制
- redis数据类型
- struts2的类型转换器