org.apache.logging.log4j.core.util
Class Booleans
java.lang.Object
org.apache.logging.log4j.core.util.Booleans
public final class Booleans
- extends Object
Boolean helpers.
Method Summary |
static boolean |
parseBoolean(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). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parseBoolean
public static boolean parseBoolean(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).
- Parameters:
s
- The String
to parse into a boolean
defaultValue
- The default value to use if s
is neither "true"
nor "false"
- Returns:
- the
boolean
value represented by the argument, or defaultValue
.
Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.