StringUtils

1,StringUtils.isNotBlank

isNotEmpty :

判断某字符串是否非空

StringUtils.isNotEmpty(null) = false

StringUtils.isNotEmpty("") = false

StringUtils.isNotEmpty(" ") = true

StringUtils.isNotEmpty("bob") = true isNotBlank:

判断某字符串是否不为空且长度不为0且不由空白符(whitespace)构成,

下面是示例:

StringUtils.isNotBlank(null) = false

StringUtils.isNotBlank("") = false

StringUtils.isNotBlank(" ") = false

StringUtils.isNotBlank("\t \n \f \r") = false

beanUtils

beanUtils 对象转map,

https://www.cnblogs.com/jing1617/p/7007580.html

<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency> 直接转,没有的字段是默认值,要自己处理,注意要先new出来,在apache-commons下需要时public

SerializationUtils.clone(obj)

Student student3 = SerializationUtils.clone(Student);

例外几种方法的深拷贝:1,set,2,json,3,dozer(没有看

ClassUtils

System.out.println(genHeader("ClassUtilsDemo"));
System.out.println("获取类实现的所有接口.");
System.out.println(ClassUtils.getAllInterfaces(Date.class));

System.out.println("获取类所有父类.");
System.out.println(ClassUtils.getAllSuperclasses(Date.class));

System.out.println("获取简单类名.");
System.out.println(ClassUtils.getShortClassName(Date.class));

System.out.println("获取包名.");
System.out.println(ClassUtils.getPackageName(Date.class));

System.out.println("判断是否可以转型.");
System.out.println(ClassUtils.isAssignable(Date.class, Object.class));
System.out.println(ClassUtils.isAssignable(Object.class, Date.class));

获取类实现的所有接口.
[interface java.io.Serializable, interface java.lang.Cloneable, interface java.lang.Comparable]
获取类所有父类.
[class java.lang.Object]
获取简单类名.
Date
获取包名.
java.util
判断是否可以转型.
true
false

WordUtils

private void wordUtilsDemo() {
System.out.println("单词处理功能");
String str1 = "wOrD";
String str2 = "ghj\nui\tpo";
System.out.println(WordUtils.capitalize(str1)); // 首字母大写
System.out.println(WordUtils.capitalizeFully(str1)); // 首字母大写其它字母小写
char[] ctrg = {'.'};
System.out.println(WordUtils.capitalizeFully("i aM.fine", ctrg)); // 在规则地方转换
System.out.println(WordUtils.initials(str1)); // 获取首字母
System.out.println(WordUtils.initials("Ben John Lee", null)); // 取每个单词的首字母
char[] ctr = {' ', '.'};
System.out.println(WordUtils.initials("Ben J.Lee", ctr)); // 按指定规则获取首字母
System.out.println(WordUtils.swapCase(str1)); // 大小写逆转
System.out.println(WordUtils.wrap(str2, 1)); // 解析\n和\t等字符}

单词处理功能
WOrD
Word
I am.Fine
w
BJL
BJL
WoRd
ghj
ui po

CollectionUtils

CollectionUtils.isNotEmpty(apply4CDtoList);
CollectionUtils.isEmpty(apply4CDtoList);

org.apache.commons等常用工具学习的更多相关文章

  1. Apache commons (Java常用工具包)简介

    Apache Commons是一个非常有用的工具包,解决各种实际的通用问题,下面是一个简述表,详细信息访问http://jakarta.apache.org/commons/index.html Be ...

  2. Maven+Spring Batch+Apache Commons VF学习

    Apache Commons VFS资料:例子:http://www.zihou.me/html/2011/04/12/3377.html详细例子:http://p7engqingyang.iteye ...

  3. Apache Commons 常用工具类整理

    其实一直都在使用常用工具类,只是从没去整理过,今天空了把一些常用的整理一下吧 怎么使用的一看就明白,另外还有注释,最后的使用pom引入的jar包 public class ApacheCommonsT ...

  4. 编写更少量的代码:使用apache commons工具类库

    Commons-configuration   Commons-FileUpload   Commons DbUtils   Commons BeanUtils  Commons CLI  Commo ...

  5. linkin大话数据结构--apache commons工具类

    Apache Commons包含了很多开源的工具,用于解决平时编程经常会遇到的问题,减少重复劳动. 一.Commons BeanUtils 说明:针对Bean的一个工具集.由于Bean往往是有一堆ge ...

  6. apache commons类库的学习

    原文地址http://www.tuicool.com/articles/iyEbquE 1.1. 开篇 在Java的世界,有很多(成千上万)开源的框架,有成功的,也有不那么成功的,有声名显赫的,也有默 ...

  7. 高性能jdbc封装工具 Apache Commons DbUtils 1.6(转载)

    转载自原文地址:http://gao-xianglong.iteye.com/blog/2166444 前言 关于Apache的DbUtils中间件或许了解的人并不多,大部分开发人员在生成环境中更多的 ...

  8. Apache Commons 工具集使用简介

    Apache Commons包含了很多开源的工具,用于解决平时编程经常会遇到的问题,减少重复劳动.我选了一些比较常用的项目做简单介绍.文中用了很多网上现成的东西,我只是做了一个汇总整理. 一.Comm ...

  9. Apache Commons 工具类介绍及简单使用

    转自:http://www.cnblogs.com/younggun/p/3247261.html Apache Commons包含了很多开源的工具,用于解决平时编程经常会遇到的问题,减少重复劳动.下 ...

随机推荐

  1. 异构去堆叠 | 一种完美提升网络高可用SLA的方案

    行业内接入网络去堆叠已经逐步成为主流方向,在大型互联网公司也已经批量部署.但由于京东集团不同的业务需求及历史原因,没有条件完全复制目前主流的ARP转主机路由方式的去堆叠方案,这促使我们设计一种尽可能满 ...

  2. selenium+python启动浏览器出错,安装浏览器驱动

    WebDriver 支持 Firefox (FirefoxDriver).IE (InternetExplorerDriver).Opera (OperaDriver) 和 Chrome (Chrom ...

  3. Linux监控

    第三十次课 Linux监控 目录 一. Linux监控平台介绍 二. zabbix监控介绍 三. 安装zabbix 四. 忘记Admin密码如何做 五. 主动模式和被动模式 六. 添加监控主机 七. ...

  4. 使用PuTTY软件远程登录root被拒:access denied

    PuTTY是一个Telnet.SSH.rlogin.纯TCP以及串行接口连接软件. 使用PuTTY软件远程登录root时,提示:ACCESS DENIED,很有可能是由sshd的默认配置造成的. 可以 ...

  5. ubuntu Error fetching https://gems.ruby-china.org/: Errno::ECONNREFUSED: Connection refused

    排除网络原因的前提下 是 权限问题  用 sudo 来 执行命令即可  sudo  gem sources -a https://gems.ruby-china.org/

  6. oracle入门之分页查询

    oracle的分页查询共三种方法 1.根据ROWID来分页(速率一般) SQL>select * from emp where rowid in (select rid from (select ...

  7. 动态流程图关于jointJs的使用

    这段时间由于业务需要,需要展现动态的流程图.具体实现效果如图所示: jointJS中的线条以及框都是依赖SVG进行的二次开发.建议初学者先学习svg里相关属性,便于在阅读jointJs的API或者de ...

  8. 关于synchronized的同步操作

    一般有两种方法 同步方法和同步代码块 假设P1.P2是同一个类的不同对象,这个类中定义了以下几种情况的同步块或同步方法,P1.P2就都可以调用它们. 1. 把synchronized当作函数修饰符时, ...

  9. json的xpath:简易数据查询

    class JsonQuery(object): def __init__(self, data): super(JsonQuery, self).__init__() self.data = dat ...

  10. WebService中用CXF框架的wsdl部署生成客户端代码时,使用cmd命令口出现wsimport不是内部或外部命令的问题

    网上有很多,都不好用,这个立竿见影的 set JAVA_HOME = *:\Program Files\Java\jdk1.8.0_181(此处为自己jdk的安装路径) set CLASSPATH = ...