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

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

Best Java code snippets using org.apache.commons.lang3.BooleanUtils (Showing top 20 results out of 2,340)

Refine searchRefine arrow

  • StringUtils
  • JsonParser
  • Inject
origin: gocd/gocd

public void setConfigAttributes(Object attributes) {
  Map attributeMap = (Map) attributes;
  this.name = (String) attributeMap.get(EnvironmentVariableConfig.NAME);
  String value = (String) attributeMap.get(EnvironmentVariableConfig.VALUE);
  if (StringUtils.isBlank(name) && StringUtils.isBlank(value)) {
    throw new IllegalArgumentException(String.format("Need not null/empty name & value %s:%s", this.name, value));
  }
  this.isSecure = BooleanUtils.toBoolean((String) attributeMap.get(EnvironmentVariableConfig.SECURE));
  Boolean isChanged = BooleanUtils.toBoolean((String) attributeMap.get(EnvironmentVariableConfig.ISCHANGED));
  if (isSecure) {
    this.encryptedValue = isChanged ? new EncryptedVariableValueConfig(encrypt(value)) : new EncryptedVariableValueConfig(value);
  } else {
    this.value = new VariableValueConfig(value);
  }
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Checks if a {@code Boolean} value is <i>not</i> {@code true},
 * handling {@code null} by returning {@code true}.</p>
 *
 * <pre>
 *   BooleanUtils.isNotTrue(Boolean.TRUE)  = false
 *   BooleanUtils.isNotTrue(Boolean.FALSE) = true
 *   BooleanUtils.isNotTrue(null)          = true
 * </pre>
 *
 * @param bool  the boolean to check, null returns {@code true}
 * @return {@code true} if the input is null or false
 * @since 2.3
 */
public static boolean isNotTrue(final Boolean bool) {
  return !isTrue(bool);
}
origin: springside/springside4

/**
 * 支持true/false, on/off, y/n, yes/no的转换, str为空或无法分析时返回null
 */
public static Boolean parseGeneralString(String str) {
  return BooleanUtils.toBooleanObject(str);
}
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: DozerMapper/dozer

private void parseFieldMap(Element ele, DozerBuilder.FieldMappingBuilder fieldMapBuilder) {
  setRelationshipType(ele, fieldMapBuilder);
  if (StringUtils.isNotEmpty(getAttribute(ele, REMOVE_ORPHANS))) {
    fieldMapBuilder.removeOrphans(BooleanUtils.toBoolean(getAttribute(ele, REMOVE_ORPHANS)));
origin: simpligility/android-maven-plugin

boolean dirty = false;
if ( StringUtils.isEmpty( parsedVersionName ) )
if ( versionNameAttrib == null || ! StringUtils.equals( parsedVersionName, versionNameAttrib.getValue() ) )
if ( !StringUtils.isEmpty( parsedApplicationIcon ) ) 
      Attr debuggableAttrib = element.getAttributeNode( ATTR_DEBUGGABLE );
      if ( debuggableAttrib == null || parsedDebuggable != BooleanUtils
          .toBoolean( debuggableAttrib.getValue() ) )
origin: BroadleafCommerce/BroadleafCommerce

boolean envOrigination = BooleanUtils.isTrue(originatedFromEnvironment.get());
if (property == null || StringUtils.isEmpty(property.getValue())) {
  if (envOrigination) {
    result = null;
origin: Swagger2Markup/swagger2markup

if (CollectionUtils.isNotEmpty(parameters)) {
  for (Parameter parameter : parameters) {
    if (StringUtils.equals(parameter.getIn(), "body")) {
      ParameterAdapter parameterAdapter = new ParameterAdapter(context,
          operation, parameter, definitionDocumentResolver);
      if (isNotBlank(description)) {
        markupDocBuilder.paragraph(markupDescription(config.getSwaggerMarkupLanguage(), markupDocBuilder, description));
      typeInfos.italicText(labels.getLabel(FLAGS_COLUMN)).textLine(COLON + (BooleanUtils.isTrue(parameter.getRequired()) ? labels.getLabel(FLAGS_REQUIRED).toLowerCase() : labels.getLabel(FLAGS_OPTIONAL).toLowerCase()));
origin: wuyouzhuguli/FEBS-Shiro

@Override
public void init(FilterConfig filterConfig) {
  logger.info("------------ xss filter init ------------");
  String isIncludeRichText = filterConfig.getInitParameter("isIncludeRichText");
  if (StringUtils.isNotBlank(isIncludeRichText)) {
    flag = BooleanUtils.toBoolean(isIncludeRichText);
  }
  String temp = filterConfig.getInitParameter("excludes");
  if (temp != null) {
    String[] url = temp.split(",");
    excludes.addAll(Arrays.asList(url));
  }
}
origin: BroadleafCommerce/BroadleafCommerce

protected void checkUser(AdminUser user, GenericResponse response) {
  if (user == null) {
    response.addErrorCode("invalidUser");
  } else if (StringUtils.isBlank(user.getEmail())) {
    response.addErrorCode("emailNotFound");
  } else if (BooleanUtils.isNotTrue(user.getActiveStatusFlag())) {
    response.addErrorCode("inactiveUser");
  }
}

origin: alibaba/nacos

private IpAddress getIPAddress(HttpServletRequest request) {
  String ip = WebUtils.required(request, "ip");
  String port = WebUtils.required(request, "port");
  String weight = WebUtils.optional(request, "weight", "1");
  String cluster = WebUtils.optional(request, "cluster", StringUtils.EMPTY);
  if (StringUtils.isEmpty(cluster)) {
    cluster = WebUtils.optional(request, "clusterName", UtilsAndCommons.DEFAULT_CLUSTER_NAME);
  }
  boolean enabled = BooleanUtils.toBoolean(WebUtils.optional(request, "enable", "true"));
  IpAddress ipAddress = new IpAddress();
  ipAddress.setPort(Integer.parseInt(port));
  ipAddress.setIp(ip);
  ipAddress.setWeight(Double.parseDouble(weight));
  ipAddress.setClusterName(cluster);
  ipAddress.setEnabled(enabled);
  return ipAddress;
}
origin: kiegroup/optaplanner

public void initBenchmarkReportDirectory(File benchmarkDirectory) {
  String timestampString = startingTimestamp.format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HHmmss"));
  if (StringUtils.isEmpty(name)) {
    name = timestampString;
  }
  if (!benchmarkDirectory.mkdirs()) {
    if (!benchmarkDirectory.isDirectory()) {
      throw new IllegalArgumentException("The benchmarkDirectory (" + benchmarkDirectory
          + ") already exists, but is not a directory.");
    }
    if (!benchmarkDirectory.canWrite()) {
      throw new IllegalArgumentException("The benchmarkDirectory (" + benchmarkDirectory
          + ") already exists, but is not writable.");
    }
  }
  int duplicationIndex = 0;
  do {
    String directoryName = timestampString + (duplicationIndex == 0 ? "" : "_" + duplicationIndex);
    duplicationIndex++;
    benchmarkReportDirectory = new File(benchmarkDirectory,
        BooleanUtils.isFalse(aggregation) ? directoryName : directoryName + "_aggregation");
  } while (!benchmarkReportDirectory.mkdir());
  for (ProblemBenchmarkResult problemBenchmarkResult : unifiedProblemBenchmarkResultList) {
    problemBenchmarkResult.makeDirs();
  }
}
origin: apache/cloudstack

  continue;
if (BooleanUtils.toBoolean(srRec.shared)) {
  continue;
  if (!isRefNull(host) && org.apache.commons.lang3.StringUtils.equals(host.getUuid(conn), _host.getUuid())) {
    if (!pbd.getCurrentlyAttached(conn)) {
      s_logger.debug(String.format("PBD [%s] of local SR [%s] was unplugged, pluggin it now", pbd.getUuid(conn), srRec.uuid));
origin: org.apache.struts/struts2-convention-plugin

/**
 * @param reload Reload configuration when classes change. Defaults to "false" and should not be used
 * in production.
 */
@Inject(ConventionConstants.CONVENTION_CLASSES_RELOAD)
public void setReload(String reload) {
  this.reload = BooleanUtils.toBoolean(reload);
}
origin: alibaba/jvm-sandbox

/**
 * 是否启用Unsafe功能
 *
 * @return unsafe.enable
 */
public boolean isEnableUnsafe() {
  return BooleanUtils.toBoolean(featureMap.get(KEY_UNSAFE_ENABLE));
}
origin: org.apache.commons/commons-lang3

/**
 * <p>Checks if a {@code Boolean} value is <i>not</i> {@code false},
 * handling {@code null} by returning {@code true}.</p>
 *
 * <pre>
 *   BooleanUtils.isNotFalse(Boolean.TRUE)  = true
 *   BooleanUtils.isNotFalse(Boolean.FALSE) = false
 *   BooleanUtils.isNotFalse(null)          = true
 * </pre>
 *
 * @param bool  the boolean to check, null returns {@code true}
 * @return {@code true} if the input is null or true
 * @since 2.3
 */
public static boolean isNotFalse(final Boolean bool) {
  return !isFalse(bool);
}
origin: org.apache.commons/commons-lang3

@Test
public void test_isNotTrue_Boolean() {
  assertFalse(BooleanUtils.isNotTrue(Boolean.TRUE));
  assertTrue(BooleanUtils.isNotTrue(Boolean.FALSE));
  assertTrue(BooleanUtils.isNotTrue(null));
}
origin: DozerMapper/dozer

private void parseMapping(Element ele, DozerBuilder builder) {
  DozerBuilder.MappingBuilder definitionBuilder = builder.mapping();
  if (StringUtils.isNotEmpty(getAttribute(ele, DATE_FORMAT))) {
    definitionBuilder.dateFormat(getAttribute(ele, DATE_FORMAT));
  if (StringUtils.isNotEmpty(getAttribute(ele, MAP_NULL_ATTRIBUTE))) {
    definitionBuilder.mapNull(BooleanUtils.toBoolean(getAttribute(ele, MAP_NULL_ATTRIBUTE)));
  if (StringUtils.isNotEmpty(getAttribute(ele, MAP_EMPTY_STRING_ATTRIBUTE))) {
    definitionBuilder.mapEmptyString(BooleanUtils.toBoolean(getAttribute(ele, MAP_EMPTY_STRING_ATTRIBUTE)));
  if (StringUtils.isNotEmpty(getAttribute(ele, BEAN_FACTORY))) {
origin: metatron-app/metatron-discovery

public Boolean rollup() {
 if (StringUtils.isEmpty(ingestion)) {
  return false;
 }
 IngestionInfo ingestionInfo = getIngestionInfo();
 if (ingestionInfo == null) {
  return false;
 }
 return BooleanUtils.isTrue(ingestionInfo.getRollup());
}
origin: org.apache.struts/struts2-convention-plugin

/**
 * @param exclude Exclude URLs found by the parent class loader. Defaults to "true", set to true for JBoss
 */
@Inject(ConventionConstants.CONVENTION_EXCLUDE_PARENT_CLASS_LOADER)
public void setExcludeParentClassLoader(String exclude) {
  this.excludeParentClassLoader = BooleanUtils.toBoolean(exclude);
}
org.apache.commons.lang3BooleanUtils

Javadoc

Operations on boolean primitives and Boolean objects.

This class tries to handle null input gracefully. An exception will not be thrown for a null input. Each method documents its behaviour in more detail.

#ThreadSafe#

Most used methods

  • 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)
  • toBooleanDefaultIfNull
    Converts a Boolean to a boolean handling null. BooleanUtils.toBooleanDefaultIfNull(Boolean.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"
  • and,
  • toStringYesNo,
  • xor,
  • toInteger,
  • compare,
  • negate,
  • toStringOnOff,
  • <init>,
  • toIntegerObject

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • getContentResolver (Context)
  • Kernel (java.awt.image)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • From CI to AI: The AI layer in your organization
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