{//判断true或false Boolean aBoolean = new Boolean(true); System.out.println(BooleanUtils.isTrue(aBoolean)); System.out.println(BooleanUtils.isFalse(aBoolean)); } {//判断不为true或不为false Boolean aBoolean = new Boolean(true); Boolean aBoolean1 = null; System.out.println(BooleanUtils.isNotTrue(aBoolean)); System.out.println(BooleanUtils.isNotTrue(aBoolean1)); System.out.println(BooleanUtils.isNotFalse(aBoolean)); System.out.println(BooleanUtils.isNotFalse(aBoolean1)); } {//转换成数字 Boolean aBoolean = new Boolean(true); Boolean aBoolean1 = new Boolean(false); System.out.println(BooleanUtils.toInteger(aBoolean)); System.out.println(BooleanUtils.toInteger(aBoolean1)); } {//Boolean转换成布尔值 Boolean aBoolean = new Boolean(true); Boolean aBoolean1 = null; System.out.println(BooleanUtils.toBoolean(aBoolean)); System.out.println(BooleanUtils.toBoolean(aBoolean1)); System.out.println(BooleanUtils.toBooleanDefaultIfNull(aBoolean1, false)); }
标签:System,println,Boolean,apache,org,lang3,out,aBoolean,BooleanUtils From: https://www.cnblogs.com/ooo0/p/17751484.html