commons-lang3

1.maven

<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-lang3</artifactId>
  <version>3.7</version>
</dependency>

2.小例子

public static void main(String[] args) {
    System.out.println(StringUtils.isEmpty(null));
    System.out.println(StringUtils.isEmpty(""));

    System.out.println(ObjectUtils.anyNotNull(null, null));
    System.out.println(ObjectUtils.anyNotNull(11, null));

    System.out.println(RandomUtils.nextBoolean());
    System.out.println(RandomUtils.nextBoolean());

    System.out.println(SystemUtils.JAVA_HOME);
}

3.总结

官网说commons-lang3主要目的是提供更多的工具类,其实也就是方便我们的开发,具体API需要自己研究。

官网:http://commons.apache.org/proper/commons-lang/index.html

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容