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.總結(jié)
官網(wǎng)說commons-lang3主要目的是提供更多的工具類梁钾,其實也就是方便我們的開發(fā)奇唤,具體API需要自己研究。
官網(wǎng):http://commons.apache.org/proper/commons-lang/index.html