Class Booleans


  • public final class Booleans
    extends java.lang.Object
    Boolean helpers.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Booleans()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method 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).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Booleans

        private Booleans()
    • Method Detail

      • parseBoolean

        public 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).
        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.