Tabnine Logo
BooleanUtils.toBooleanDefaultIfNull
Code IndexAdd Tabnine to your IDE (free)

How to use
toBooleanDefaultIfNull
method
in
org.apache.commons.lang3.BooleanUtils

Best Java code snippets using org.apache.commons.lang3.BooleanUtils.toBooleanDefaultIfNull (Showing top 19 results out of 315)

origin: springside/springside4

/**
 * 支持true/false,on/off, y/n, yes/no的转换, str为空或无法分析时返回defaultValue
 */
public static Boolean parseGeneralString(String str, Boolean defaultValue) {
  return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(str), defaultValue);
}
origin: org.apache.commons/commons-lang3

@Test
public void test_toBooleanDefaultIfNull_Boolean_boolean() {
  assertTrue(BooleanUtils.toBooleanDefaultIfNull(Boolean.TRUE, true));
  assertTrue(BooleanUtils.toBooleanDefaultIfNull(Boolean.TRUE, false));
  assertFalse(BooleanUtils.toBooleanDefaultIfNull(Boolean.FALSE, true));
  assertFalse(BooleanUtils.toBooleanDefaultIfNull(Boolean.FALSE, false));
  assertTrue(BooleanUtils.toBooleanDefaultIfNull(null, true));
  assertFalse(BooleanUtils.toBooleanDefaultIfNull(null, false));
}
origin: com.haulmont.reports/reports-gui

  protected boolean isTreeMustContainRoot(Map<String, Object> params) {
    return BooleanUtils.toBooleanDefaultIfNull((Boolean) params.get("showRoot"), true);
  }
}
origin: com.haulmont.reports/reports-gui

protected boolean isTreeForPersistentOnly(Map<String, Object> params) {
  return BooleanUtils.toBooleanDefaultIfNull((Boolean) params.get("persistentOnly"), false);
}
origin: com.haulmont.reports/reports-gui

protected boolean isTreeForCollectionsOnly(Map<String, Object> params) {
  return BooleanUtils.toBooleanDefaultIfNull((Boolean) params.get("collectionsOnly"), false);
}
origin: com.haulmont.reports/reports-gui

protected boolean isTreeForScalarOnly(Map<String, Object> params) {
  return BooleanUtils.toBooleanDefaultIfNull((Boolean) params.get("scalarOnly"), false);
}
origin: io.springside/springside-utils

/**
 * 支持true/false,on/off, y/n, yes/no的转换, str为空或无法分析时返回defaultValue
 */
public static Boolean parseGeneralString(String str, Boolean defaultValue) {
  return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(str), defaultValue);
}
origin: DarLiner/vjtools

/**
 * 支持true/false,on/off, y/n, yes/no的转换, str为空或无法分析时返回defaultValue
 */
public static Boolean parseGeneralString(String str, Boolean defaultValue) {
  return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(str), defaultValue);
}
origin: xuminwlt/j360-dubbo-app-all

/**
 * 支持true/false,on/off, y/n, yes/no的转换, str为空或无法分析时返回defaultValue
 */
public static Boolean parseGeneralString(String str, Boolean defaultValue) {
  return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(str), defaultValue);
}
origin: ontopia/ontopia

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

origin: org.xwiki.platform/xwiki-platform-skin-skinx

@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();
}
origin: com.cognifide.aet/jobs

@Override
public void setParameters(Map<String, String> params) throws ParametersException {
 setElementParams(params);
 leaveBlankSpace = BooleanUtils.toBooleanDefaultIfNull(
   BooleanUtils.toBooleanObject(params.get(LEAVE_BLANK_SPACE_PARAM)),
   LEAVE_BLANK_SPACE_DEFAULT);
}
origin: Cognifide/aet

@Override
public void setParameters(Map<String, String> params) throws ParametersException {
 setElementParams(params);
 leaveBlankSpace = BooleanUtils.toBooleanDefaultIfNull(
   BooleanUtils.toBooleanObject(params.get(LEAVE_BLANK_SPACE_PARAM)),
   LEAVE_BLANK_SPACE_DEFAULT);
}
origin: alexo/wro4j

private boolean valueAsBoolean(final Object object, final boolean defaultValue) {
 return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(valueAsString(object)), defaultValue);
}
origin: ro.isdc.wro4j/wro4j-core

private boolean valueAsBoolean(final Object object, final boolean defaultValue) {
 return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(valueAsString(object)), defaultValue);
}
origin: com.atlassian.plugins/atlassian-connect-confluence-modules

private void initialise() {
  bodyType = ObjectUtils.defaultIfNull(bodyType, CustomContentBodyType.STORAGE);
  supportedChildTypes = ObjectUtils.defaultIfNull(supportedChildTypes, Sets.newHashSet());
  preventDuplicateTitle = BooleanUtils.toBooleanDefaultIfNull(preventDuplicateTitle, false);
  indexing = ObjectUtils.defaultIfNull(indexing, new CustomContentIndexingBean());
}
origin: org.xwiki.platform/xwiki-platform-skin-skinx

@Override
public String getLink(String filename, XWikiContext context)
{
  boolean forceSkinAction = BooleanUtils.toBoolean((Boolean) getParameter("forceSkinAction", filename, context));
  StringBuilder result = new StringBuilder("<script type='text/javascript' src='");
  result.append(context.getWiki().getSkinFile(filename, forceSkinAction, context));
  if (forceSkinAction) {
    String parameters = StringUtils.removeStart(parametersAsQueryString(filename, context), "&amp;");
    if (!StringUtils.isEmpty(parameters)) {
      result.append("?").append(parameters);
    }
  }
  // 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", filename, context), defaultDefer)) {
    result.append("' defer='defer");
  }
  result.append("'></script>\n");
  return result.toString();
}
origin: org.xwiki.platform/xwiki-platform-skin-skinx

@Override
public String getLink(String documentName, XWikiContext context)
{
  DocumentReference documentReference = getCurrentDocumentReferenceResolver().resolve(documentName);
  if (!isAccessible(documentReference, context)) {
    // No access to view the Skin Extension's document. Don`t generate any link to avoid a useless network
    // request always leading to a 403 Error.
    return "";
  }
  StringBuilder result = new StringBuilder("<script type='text/javascript' src='");
  result.append(getDocumentSkinExtensionURL(documentReference, documentName, PLUGIN_NAME, context));
  // 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", documentName, context), defaultDefer)) {
    result.append("' defer='defer");
  }
  result.append("'></script>\n");
  return result.toString();
}
origin: org.apache.struts/struts2-javatemplates-plugin

public void generate() throws IOException {
  Map<String, Object> params = context.getParameters();
  Object errorsObj = findValue(getListExpression());
  if (errorsObj != null) {
    Iterator itt = MakeIterator.convert(errorsObj);
    if (itt.hasNext()) {
      boolean escape = BooleanUtils.toBooleanDefaultIfNull((Boolean) params.get("escape"), false);
      Attributes attrs = new Attributes();
      attrs.addIfExists("style", params.get("cssStyle"))
          .add("class", params.containsKey("cssClass") ? (String) params.get("cssClass") : getDefaultClass());
      start("ul", attrs);
      while (itt.hasNext()) {
        String error = (String) itt.next();
        //li for each error
        start("li", null);
        //span for error
        start("span", null);
        characters(error, escape);
        end("span");
        end("li");
      }
      end("ul");
    }
  }
}
org.apache.commons.lang3BooleanUtilstoBooleanDefaultIfNull

Javadoc

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 

Popular methods of BooleanUtils

  • toBoolean
    Converts a String to a Boolean throwing an exception if no match found. BooleanUtils.toBoolean("t
  • isTrue
    Checks if a Boolean value is true, handling null by returning false. BooleanUtils.isTrue(Boolean.
  • toBooleanObject
    Converts a String to a Boolean throwing an exception if no match. NOTE: This returns null and will
  • isFalse
    Checks if a Boolean value is false, handling null by returning false. BooleanUtils.isFalse(Boolea
  • isNotTrue
    Checks if a Boolean value is not true, handling null by returning true. BooleanUtils.isNotTrue(Bo
  • toStringTrueFalse
    Converts a boolean to a String returning 'true'or 'false'. BooleanUtils.toStringTrueFalse(true)
  • toString
    Converts a boolean to a String returning one of the input Strings. BooleanUtils.toString(true, "t
  • isNotFalse
    Checks if a Boolean value is not false, handling null by returning true. BooleanUtils.isNotFalse(
  • or
    Performs an or on a set of booleans. BooleanUtils.or(true, true) = true BooleanUtils.or
  • and
    Performs an and on a set of booleans. BooleanUtils.and(true, true) = true BooleanUtils.a
  • toStringYesNo
    Converts a boolean to a String returning 'yes'or 'no'. BooleanUtils.toStringYesNo(true) = "yes"
  • xor
    Performs an xor on a set of booleans. BooleanUtils.xor(true, true) = false BooleanUtils.xor(fa
  • toStringYesNo,
  • xor,
  • toInteger,
  • compare,
  • negate,
  • toStringOnOff,
  • <init>,
  • toIntegerObject

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Notification (javax.management)
  • JFileChooser (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now