Class BooleanUtils


  • public class BooleanUtils
    extends org.apache.commons.lang3.BooleanUtils
    Utility methods for booleans.
    Author:
    avasquez
    • Field Summary

      • Fields inherited from class org.apache.commons.lang3.BooleanUtils

        FALSE, NO, OFF, ON, TRUE, YES
    • Constructor Summary

      Constructors 
      Constructor Description
      BooleanUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean toBoolean​(Object obj)
      Converts an object to boolean, according to the following logic: If it's null, false is returned. If it's a Boolean, the same object is returned. If it's any other object, the toString() value is converted to boolean.
      • Methods inherited from class org.apache.commons.lang3.BooleanUtils

        and, and, booleanValues, compare, isFalse, isNotFalse, isNotTrue, isTrue, negate, or, or, primitiveValues, toBoolean, toBoolean, toBoolean, toBoolean, toBoolean, toBoolean, toBooleanDefaultIfNull, toBooleanObject, toBooleanObject, toBooleanObject, toBooleanObject, toBooleanObject, toBooleanObject, toInteger, toInteger, toInteger, toIntegerObject, toIntegerObject, toIntegerObject, toIntegerObject, toString, toString, toStringOnOff, toStringOnOff, toStringTrueFalse, toStringTrueFalse, toStringYesNo, toStringYesNo, xor, xor
    • Constructor Detail

      • BooleanUtils

        public BooleanUtils()
    • Method Detail

      • toBoolean

        public static boolean toBoolean​(Object obj)
        Converts an object to boolean, according to the following logic:
        1. If it's null, false is returned.
        2. If it's a Boolean, the same object is returned.
        3. If it's any other object, the toString() value is converted to boolean.
        Parameters:
        obj -
        Returns:
        boolean value