commons-lang3

作者: jsjack_wang | 来源:发表于2018-04-11 15:48 被阅读0次

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

相关文章

网友评论

    本文标题:commons-lang3

    本文链接:https://www.haomeiwen.com/subject/raczhftx.html