public final class Booleans extends Object
boolean primitives.| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
isBoolean(char[] text,
int offset,
int length)
returns true iff the sequence of chars is one of "true","false".
|
static boolean |
isBoolean(String value) |
static boolean |
isFalse(String value) |
static boolean |
isTrue(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(String value)
Parses a string representation of a boolean value to
boolean. |
static boolean |
parseBoolean(String value,
boolean defaultValue) |
static Boolean |
parseBoolean(String value,
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(String value)
public static boolean isFalse(String value)
true iff the value is "false", otherwise false.public static boolean isTrue(String value)
true iff the value is "true", otherwise false.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.IllegalArgumentException - if the string cannot be parsed to boolean.public static boolean parseBoolean(String value)
boolean.true iff the provided value is "true". false iff the provided value is "false".IllegalArgumentException - if the string cannot be parsed to boolean.public static boolean parseBoolean(String value, boolean defaultValue)
value - text to parse.defaultValue - The default value to return if the provided value is null.parseBoolean(String)Copyright © 2021. All rights reserved.