Example usage for org.apache.commons.lang3 BooleanUtils toBooleanDefaultIfNull

List of usage examples for org.apache.commons.lang3 BooleanUtils toBooleanDefaultIfNull

Introduction

In this page you can find the example usage for org.apache.commons.lang3 BooleanUtils toBooleanDefaultIfNull.

Prototype

public static boolean toBooleanDefaultIfNull(final Boolean bool, final boolean valueIfNull) 

Source Link

Document

Converts a Boolean to a boolean handling null .

 BooleanUtils.toBooleanDefaultIfNull(Boolean.TRUE, false) = true BooleanUtils.toBooleanDefaultIfNull(Boolean.FALSE, true) = false BooleanUtils.toBooleanDefaultIfNull(null, true)          = true 

Usage

From source file:net.ontopia.utils.PropertyUtils.java

public static boolean isTrue(String property_value, boolean default_value) {
    return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(property_value), default_value);
}

From source file:com.adaptris.jdbc.CallableStatementExecutorImpl.java

protected boolean ignoreMoreResultsException() {
    return BooleanUtils.toBooleanDefaultIfNull(getHandleMultipleResultsetsQuietly(), false);
}

From source file:com.adaptris.core.services.aggregator.MessageAggregatorImpl.java

protected boolean overwriteMetadata() {
    return BooleanUtils.toBooleanDefaultIfNull(getOverwriteMetadata(), false);
}

From source file:com.adaptris.core.services.metadata.xpath.XpathQueryImpl.java

protected boolean allowEmptyResults() {
    return BooleanUtils.toBooleanDefaultIfNull(getAllowEmptyResults(), false);
}

From source file:com.esri.geoportal.harvester.ckan.CkanBrokerDefinitionAdaptor.java

/**
 * Initializes adaptor from definition.//  w w  w  . ja v  a 2 s . c  o  m
 * @param def broker definition
 * @throws InvalidDefinitionException if definition is invalid
 */
protected void initialize(EntityDefinition def) throws InvalidDefinitionException {
    apiKey = get(P_API_KEY);
    emitXml = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_XML)), true);
    emitJson = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_JSON)), false);

    try {
        hostUrl = new URL(get(P_HOST_URL));
    } catch (MalformedURLException ex) {
        throw new InvalidDefinitionException(String.format("Invalid %s: %s", P_HOST_URL, get(P_HOST_URL)), ex);
    }
}

From source file:com.adaptris.core.jms.PasConsumer.java

boolean durable() {
    return BooleanUtils.toBooleanDefaultIfNull(getDurable(), false);
}

From source file:com.cognifide.aet.job.common.modifiers.hide.HideModifier.java

@Override
public void setParameters(Map<String, String> params) throws ParametersException {
    setElementParams(params);/*from w w w .  j a v  a  2s .co  m*/
    leaveBlankSpace = BooleanUtils.toBooleanDefaultIfNull(
            BooleanUtils.toBooleanObject(params.get(LEAVE_BLANK_SPACE_PARAM)), LEAVE_BLANK_SPACE_DEFAULT);
}

From source file:com.adaptris.core.services.exception.ExceptionAsString.java

boolean includeStackTrace() {
    return BooleanUtils.toBooleanDefaultIfNull(getIncludeStackTrace(), true);
}

From source file:com.adaptris.core.ftp.FtpSslConnection.java

private boolean implicitSSL() {
    return BooleanUtils.toBooleanDefaultIfNull(getImplicitSsl(), false);
}

From source file:com.xpn.xwiki.plugin.skinx.JsResourceSkinExtensionPlugin.java

/**
 * {@inheritDoc}/*from   w w  w . j a  va 2  s .  c  om*/
 * 
 * @see AbstractResourceSkinExtensionPlugin#generateLink(String, String, XWikiContext)
 */
@Override
protected String generateLink(String url, String resourceName, XWikiContext context) {
    StringBuilder result = new StringBuilder("<script type='text/javascript' src='").append(url).append("'");
    // check if js should be deferred, defaults to the preference configured in the cfg file, which defaults to true
    String defaultDeferString = context.getWiki().Param(DEFER_DEFAULT_PARAM);
    Boolean defaultDefer = (!StringUtils.isEmpty(defaultDeferString)) ? Boolean.valueOf(defaultDeferString)
            : true;
    if (BooleanUtils.toBooleanDefaultIfNull((Boolean) getParameter("defer", resourceName, context),
            defaultDefer)) {
        result.append(" defer='defer'");
    }
    result.append("></script>\n");
    return result.toString();
}