public final class Booleans
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
Booleans() |
Modifier and Type | Method and Description |
---|---|
static boolean |
parseBoolean(java.lang.String s,
boolean defaultValue)
Returns
true if s is "true" (case-insensitive), false if s is
"false" (case-insensitive), and defaultValue if s is anything else (including null or
empty). |
public static boolean parseBoolean(java.lang.String s, boolean defaultValue)
true
if s
is "true"
(case-insensitive), false
if s
is
"false"
(case-insensitive), and defaultValue
if s
is anything else (including null or
empty).s
- The String
to parse into a boolean
defaultValue
- The default value to use if s
is neither "true"
nor "false"
boolean
value represented by the argument, or defaultValue
.