public class Booleans
extends java.lang.Object
Constructor and Description |
---|
Booleans() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isBoolean(char[] text,
int offset,
int length)
returns true if the a sequence of chars is one of "true","false","on","off","yes","no","0","1"
|
static boolean |
isBoolean(java.lang.String text) |
static boolean |
isExplicitFalse(java.lang.String value)
Returns
true iff the value is either of the following:
false, 0, off, no
otherwise false |
static boolean |
isExplicitTrue(java.lang.String value)
Returns
true iff the value is either of the following:
true, 1, on, yes
otherwise false |
static boolean |
isStrictlyBoolean(java.lang.String value) |
static boolean |
parseBoolean(java.lang.String value,
boolean defaultValue)
Returns
true iff the value is neither of the following:
false, 0, off, no
otherwise false |
static java.lang.Boolean |
parseBoolean(java.lang.String value,
java.lang.Boolean defaultValue) |
static java.lang.Boolean |
parseBooleanExact(java.lang.String value) |
static java.lang.Boolean |
parseBooleanExact(java.lang.String value,
java.lang.Boolean defaultValue) |
public static boolean isBoolean(char[] text, int offset, int length)
text
- sequence to checkoffset
- offset to startlength
- length to checkpublic static boolean isBoolean(java.lang.String text)
public static java.lang.Boolean parseBooleanExact(java.lang.String value, java.lang.Boolean defaultValue)
public static java.lang.Boolean parseBooleanExact(java.lang.String value)
public static boolean isStrictlyBoolean(java.lang.String value)
public static java.lang.Boolean parseBoolean(java.lang.String value, java.lang.Boolean defaultValue)
public static boolean parseBoolean(java.lang.String value, boolean defaultValue)
true
iff the value is neither of the following:
false, 0, off, no
otherwise false
public static boolean isExplicitFalse(java.lang.String value)
true
iff the value is either of the following:
false, 0, off, no
otherwise false
public static boolean isExplicitTrue(java.lang.String value)
true
iff the value is either of the following:
true, 1, on, yes
otherwise false