public class BooleanUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
isFalse(Boolean bool)
Checks if a
Boolean value is false,
handling null by returning false. |
static boolean |
isNotFalse(Boolean bool)
Checks if a
Boolean value is not false,
handling null by returning true. |
static boolean |
isNotTrue(Boolean bool)
Checks if a
Boolean value is not true,
handling null by returning true. |
static boolean |
isTrue(Boolean bool)
Checks if a
Boolean value is true,
handling null by returning false. |
static Boolean |
valueOf(String str)
String to boolean
|
public static boolean isTrue(Boolean bool)
Checks if a Boolean value is true,
handling null by returning false.
BooleanUtils.isTrue(Boolean.TRUE) = true BooleanUtils.isTrue(Boolean.FALSE) = false BooleanUtils.isTrue(null) = false
bool - the boolean to check, null returns falsetrue only if the input is non-null and truepublic static boolean isNotTrue(Boolean bool)
Checks if a Boolean value is not true,
handling null by returning true.
BooleanUtils.isNotTrue(Boolean.TRUE) = false BooleanUtils.isNotTrue(Boolean.FALSE) = true BooleanUtils.isNotTrue(null) = true
bool - the boolean to check, null returns truetrue if the input is null or falsepublic static boolean isFalse(Boolean bool)
Checks if a Boolean value is false,
handling null by returning false.
BooleanUtils.isFalse(Boolean.TRUE) = false BooleanUtils.isFalse(Boolean.FALSE) = true BooleanUtils.isFalse(null) = false
bool - the boolean to check, null returns falsetrue only if the input is non-null and falsepublic static boolean isNotFalse(Boolean bool)
Checks if a Boolean value is not false,
handling null by returning true.
BooleanUtils.isNotFalse(Boolean.TRUE) = true BooleanUtils.isNotFalse(Boolean.FALSE) = false BooleanUtils.isNotFalse(null) = true
bool - the boolean to check, null returns truetrue if the input is null or trueCopyright © 2018–2022 Alibaba Group. All rights reserved.