public static boolean toBoolean(String value, boolean defaultValue) {
    """
	If <code>value</code> is "true", then <code>true</code> is returned. If
	<code>value</code> is "false", then <code>true</code> is returned.
	Otherwise, <code>default</code> is returned.
	<p>
	Case of value is unimportant.
	@param value string to be evaluated
	@param defaultValue default value if value could not be converted
	@return the equivalent boolean value
    """
    if (value == null) {
      return defaultValue;
    }

    String trimmedVal = value.trim();

    if ("true".equalsIgnoreCase(trimmedVal)) {
      return true;
    }

    if ("false".equalsIgnoreCase(trimmedVal)) {
      return false;
    }

    return defaultValue;
  }
public static boolean toBoolean(String value, boolean defaultValue) {
    if (value == null) {
      return defaultValue;
    }

    String trimmedVal = value.trim();

    if ("true".equalsIgnoreCase(trimmedVal)) {
      return true;
    }

    if ("false".equalsIgnoreCase(trimmedVal)) {
      return false;
    }

    return defaultValue;
  }
public static boolean toBoolean ( String value , boolean defaultValue ) { if ( value == null ) { return defaultValue ; } String trimmedVal = value . trim ( ) ; if ( "true" . equalsIgnoreCase ( trimmedVal ) ) { return true ; } if ( "false" . equalsIgnoreCase ( trimmedVal ) ) { return false ; } return defaultValue ; }
If <code>value</code> is "true", then <code>true</code> is returned. If
<code>value</code> is "false", then <code>true</code> is returned.
Otherwise, <code>default</code> is returned.
<p>
Case of value is unimportant.
@param value string to be evaluated
@param defaultValue default value if value could not be converted
@return the equivalent boolean value
If <code > value< / code > is true then <code > true< / code > is returned . If <code > value< / code > is false then <code > true< / code > is returned . Otherwise <code > default< / code > is returned . <p > Case of value is unimportant .