public final class Booleans
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static boolean |
isBoolean(char[] text,
int offset,
int length) |
returns true iff the sequence of chars is one of "true","false".
|
static boolean |
isBoolean(java.lang.String value) |
|
static boolean |
isBooleanLenient(char[] text,
int offset,
int length) |
Deprecated.
Only kept to provide automatic upgrades for pre 6.0 indices.
|
static boolean |
isFalse(java.lang.String value) |
|
static boolean |
isTrue(java.lang.String value) |
|
static boolean |
parseBoolean(char[] text,
int offset,
int length,
boolean defaultValue) |
Parses a char[] representation of a boolean value to
boolean. |
static boolean |
parseBoolean(java.lang.String value) |
Parses a string representation of a boolean value to
boolean. |
static boolean |
parseBoolean(java.lang.String value,
boolean defaultValue) |
|
static java.lang.Boolean |
parseBoolean(java.lang.String value,
java.lang.Boolean defaultValue) |
|
static boolean |
parseBooleanLenient(char[] text,
int offset,
int length,
boolean defaultValue) |
Deprecated.
Only kept to provide automatic upgrades for pre 6.0 indices.
|
static boolean |
parseBooleanLenient(java.lang.String value,
boolean defaultValue) |
Deprecated.
Only kept to provide automatic upgrades for pre 6.0 indices.
|
static java.lang.Boolean |
parseBooleanLenient(java.lang.String value,
java.lang.Boolean defaultValue) |
Deprecated.
Only kept to provide automatic upgrades for pre 6.0 indices.
|
public static boolean parseBoolean(char[] text,
int offset,
int length,
boolean defaultValue)
boolean.true iff the sequence of chars is "true", false iff the sequence of chars is "false" or the
provided default value iff either text is null or length == 0.java.lang.IllegalArgumentException - if the string cannot be parsed to boolean.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 value)
public static boolean parseBoolean(java.lang.String value)
boolean.true iff the provided value is "true". false iff the provided value is "false".java.lang.IllegalArgumentException - if the string cannot be parsed to boolean.public static boolean parseBoolean(java.lang.String value,
boolean defaultValue)
value - text to parse.defaultValue - The default value to return if the provided value is null.parseBoolean(String)public static java.lang.Boolean parseBoolean(java.lang.String value,
java.lang.Boolean defaultValue)
@Deprecated
public static java.lang.Boolean parseBooleanLenient(java.lang.String value,
java.lang.Boolean defaultValue)
parseBoolean(String, Boolean) instead.false if text is in false, 0, off, no; else, true@Deprecated
public static boolean parseBooleanLenient(java.lang.String value,
boolean defaultValue)
parseBoolean(String, boolean) instead.true iff the value is neither of the following:
false, 0, off, no
otherwise falsepublic static boolean isFalse(java.lang.String value)
true iff the value is false, otherwise false.public static boolean isTrue(java.lang.String value)
true iff the value is true, otherwise false@Deprecated
public static boolean parseBooleanLenient(char[] text,
int offset,
int length,
boolean defaultValue)
parseBoolean(char[], int, int, boolean) insteadfalse if text is in false, 0, off, no; else, true@Deprecated
public static boolean isBooleanLenient(char[] text,
int offset,
int length)
isBoolean(char[], int, int) instead.text - sequence to checkoffset - offset to startlength - length to check