Method used for coercing an object to a boolean value,
thanks to an <code>asBoolean()</code> method added on types.

@param object to coerce to a boolean value
@return a boolean value
496058
public static boolean castToBoolean(Object object) {
        // null is always false
        if (object == null) {
            return false;
        }

        // equality check is enough and faster than instanceof check, no need to check superclasses since Boolean is final
        if (object.getClass() == Boolean.class) {
            return (Boolean) object;
        }

        // if the object is not null and no Boolean, try to call an asBoolean() method on the object
        return (Boolean) InvokerHelper.invokeMethod(object, "asBoolean", InvokerHelper.EMPTY_ARGS);
    }
8008
public boolean getBoolean(String key, boolean def) {
        Object tmp = objectMap.get(key);
        return tmp != null && tmp instanceof Boolean ? (Boolean) tmp : def;
    }
98790
private static Object toBoolean( String value)
    {
    return
      "true".equalsIgnoreCase( value)?
      Boolean.TRUE :

      "false".equalsIgnoreCase( value)?
      Boolean.FALSE :

      null;
    }
693716
public boolean getBoolean(String key, boolean defaultValue) {
    String value = get(key);
    // We can't use `Boolean.parseBoolean` here, as it returns false for invalid strings.
    if (value == null) {
      return defaultValue;
    } else if (value.equalsIgnoreCase("true")) {
      return true;
    } else if (value.equalsIgnoreCase("false")) {
      return false;
    } else {
      throw new IllegalArgumentException(value + " is not a boolean string.");
    }
  }
877673
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;

	}
1274721
@Override
	public Boolean getPropertyBoolean(String key)
	{
		Boolean bVal = null;
		String sVal = getProperty(key);
		if ((sVal != null) && (sVal.length() > 0))
		{
			bVal = Boolean.valueOf(sVal);
		}
		return bVal;
	}
1346171
public boolean getBoolean(String key, boolean defaultResponse) {
        Boolean b = (Boolean) get(key);
        if (b != null) {
            return b.booleanValue();
        }
        return defaultResponse;
    }
1280144
public boolean getBoolean(String key) throws JSONException {
        Object object = this.get(key);
        if (object.equals(Boolean.FALSE)
                || (object instanceof String && ((String) object)
                        .equalsIgnoreCase("false"))) {
            return false;
        } else if (object.equals(Boolean.TRUE)
                || (object instanceof String && ((String) object)
                        .equalsIgnoreCase("true"))) {
            return true;
        }
        throw new JSONException("JSONObject[" + quote(key)
                + "] is not a Boolean.");
    }
1259085
public static final Function<Double,Boolean> eq(final Double object) {
        return (Function<Double,Boolean>)((Function)FnObject.eq(object));
    }
560816
def get_as_boolean(self, key):
        
        value = self.get(key)
        return BooleanConverter.to_boolean(value)
751244
@Override
	public boolean remove(Object object) {
		if (booleanTerms == null) {
			return false;
		}
		return booleanTerms.remove(object);
	}
364424
public boolean isTrue(Object key) {
		Object value = get(key);
		return (value instanceof Boolean && ((Boolean)value == true));
	}
717971
public BooleanType castToBoolean(Base b) throws FHIRException {
		if (b instanceof BooleanType)
			return (BooleanType) b;
		else
			throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Boolean");
	}
674857
public Boolean getAsBoolean() {
		if (value instanceof String) {
			return Boolean.parseBoolean((String)value);
		}
		return (Boolean)value;
	}
1142666
function boolean(value) {
  var parsedBoolean = json(value);

  // handle 0|1 case
  if (typeOf(parsedBoolean) == 'number' && [0, 1].indexOf(parsedBoolean) > -1) {
    parsedBoolean = parsedBoolean === 0 ? false : true;
  }

  // couldn't parse it
  if (typeOf(parsedBoolean) != 'boolean') {
    return throwModifierError('boolean', value, {message: 'Invalid Boolean'});
  }

  return parsedBoolean;
}
1123124
private static Boolean castToBoolean(Object val) //was BooleanValue
  {
    if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(cclass, "castToBoolean", val);
    Boolean theReturn = null;
    if (val instanceof String)
    {
      String stringVal = (String) val;
      if (stringVal.equalsIgnoreCase("true"))
        theReturn = Boolean.TRUE; // was BooleanValue.TRUE
      else
        if (stringVal.equalsIgnoreCase("false"))
          theReturn = Boolean.FALSE; // was BooleanValue.FALSE
    }
    if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(cclass, "castToBoolean", theReturn);    
    return theReturn;
  }
734531
public static boolean toBooleanValue(String str) throws PageException {
	Boolean b = toBoolean(str, null);
	if (b != null) return b.booleanValue();
	throw new CasterException("Can't cast String [" + CasterException.crop(str) + "] to a boolean");
    }