Operations on boolean primitives and Boolean objects. This class tries to handle null input gracefully. An exception will not be thrown for a null input. Each method documents its behavior in more detail. #ThreadSafe# @since 2.0
| 35 | * @since 2.0 |
| 36 | */ |
| 37 | public class BooleanUtils { |
| 38 | |
| 39 | private static final List<Boolean> BOOLEAN_LIST = Collections.unmodifiableList(Arrays.asList(Boolean.FALSE, Boolean.TRUE)); |
| 40 | |
| 41 | /** |
| 42 | * The false String {@code "false"}. |
| 43 | * |
| 44 | * @since 3.12.0 |
| 45 | */ |
| 46 | public static final String FALSE = "false"; |
| 47 | |
| 48 | /** |
| 49 | * The no String {@code "no"}. |
| 50 | * |
| 51 | * @since 3.12.0 |
| 52 | */ |
| 53 | public static final String NO = "no"; |
| 54 | |
| 55 | /** |
| 56 | * The off String {@code "off"}. |
| 57 | * |
| 58 | * @since 3.12.0 |
| 59 | */ |
| 60 | public static final String OFF = "off"; |
| 61 | |
| 62 | /** |
| 63 | * The on String {@code "on"}. |
| 64 | * |
| 65 | * @since 3.12.0 |
| 66 | */ |
| 67 | public static final String ON = "on"; |
| 68 | |
| 69 | /** |
| 70 | * The true String {@code "true"}. |
| 71 | * |
| 72 | * @since 3.12.0 |
| 73 | */ |
| 74 | public static final String TRUE = "true"; |
| 75 | |
| 76 | /** |
| 77 | * The yes String {@code "yes"}. |
| 78 | * |
| 79 | * @since 3.12.0 |
| 80 | */ |
| 81 | public static final String YES = "yes"; |
| 82 | |
| 83 | /** |
| 84 | * Performs an 'and' operation on a set of booleans. |
| 85 | * |
| 86 | * <pre> |
| 87 | * BooleanUtils.and(true, true) = true |
| 88 | * BooleanUtils.and(false, false) = false |
| 89 | * BooleanUtils.and(true, false) = false |
| 90 | * BooleanUtils.and(true, true, false) = false |
| 91 | * BooleanUtils.and(true, true, true) = true |
| 92 | * </pre> |
| 93 | * |
| 94 | * @param array an array of {@code boolean}s |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…