public class BooleanUtil
extends org.apache.commons.lang3.BooleanUtils
| 构造器和说明 |
|---|
BooleanUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
toBoolean(String str)
将字符串 转为 boolean.
|
and, and, isFalse, isNotFalse, isNotTrue, isTrue, negate, or, or, toBoolean, toBoolean, toBoolean, toBoolean, toBoolean, toBooleanDefaultIfNull, toBooleanObject, toBooleanObject, toBooleanObject, toBooleanObject, toBooleanObject, toBooleanObject, toInteger, toInteger, toInteger, toIntegerObject, toIntegerObject, toIntegerObject, toIntegerObject, toString, toString, toStringOnOff, toStringOnOff, toStringTrueFalse, toStringTrueFalse, toStringYesNo, toStringYesNo, xor, xorpublic static boolean toBoolean(String str)
将字符串 转为 boolean.
'true', 'on', 'y', 't' or 'yes' (case
insensitive) will return true. Otherwise, false is returned.
NOTE: 如果为空,则为 false.
// N.B. case is not significant
BooleanUtils.toBoolean("true") = Boolean.TRUE
BooleanUtils.toBoolean("T") = Boolean.TRUE // i.e. T[RUE]
BooleanUtils.toBoolean("on") = Boolean.TRUE
BooleanUtils.toBoolean("ON") = Boolean.TRUE
BooleanUtils.toBoolean("yes") = Boolean.TRUE
BooleanUtils.toBoolean("Y") = Boolean.TRUE // i.e. Y[ES]
str - the String to check; 不区分大小写false if no match or
null inputCopyright © 2024. All rights reserved.