code: public static boolean toBoolean(Object value, boolean defaultValue) {
  		boolean result;// = defaultValue;
  		if (value != null) {
  			if (value instanceof Boolean) {
  				return ((Boolean) value).booleanValue();
  			}
  
  			if (value.toString().trim().equals("1") || value.toString().trim().toLowerCase().equals("true")) {
  				result = true;
  			} else {
  				result = false;
  			}
  		} else {
  			result = defaultValue;
  		}
  		return result;
  
  	}
docs: To boolean.
  
  @param value        the value
  @param defaultValue the default value
  @return true, if successful