Refine search
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); } }
/** * <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); }
/** * 支持true/false, on/off, y/n, yes/no的转换, str为空或无法分析时返回null */ public static Boolean parseGeneralString(String str) { return BooleanUtils.toBooleanObject(str); }
/** * 支持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); }
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)));
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() ) )
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()));
@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)); } }
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"); } }
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; }
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(); } }
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));
/** * 是否启用Unsafe功能 * * @return unsafe.enable */ public boolean isEnableUnsafe() { return BooleanUtils.toBoolean(featureMap.get(KEY_UNSAFE_ENABLE)); }
/** * <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); }
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))) {
/** * @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); }