Refine search
@Override public String getName() { String name = StandardConnection.this.getName(); final Collection<Relationship> relationships = getRelationships(); if (name == null && CollectionUtils.isNotEmpty(relationships)) { name = StringUtils.join(relationships.stream().map(relationship -> relationship.getName()).collect(Collectors.toSet()), ", "); } if (name == null) { name = "Connection"; } return name; }
public static final boolean isRestoreEnabled(IConfiguration conf, InstanceInfo instanceInfo) { boolean isRestoreMode = StringUtils.isNotBlank(conf.getRestoreSnapshot()); boolean isBackedupRac = (CollectionUtils.isEmpty(conf.getBackupRacs()) || conf.getBackupRacs().contains(instanceInfo.getRac())); return (isRestoreMode && isBackedupRac); }
@Override public boolean equals(Object o) { if (this == o) { return true; } CRFilter that = (CRFilter)o; if(that == null) return false; if (ignore != null ? !CollectionUtils.isEqualCollection(this.ignore, that.ignore) : that.ignore != null) { return false; } if (whitelist != null ? !CollectionUtils.isEqualCollection(this.whitelist, that.whitelist) : that.whitelist != null) { return false; } return true; }
return isEqualCollection(collect(a, transformer), collect(b, transformer));
protected Sku findMatchingSku(Product product, Map<String, String> attributeValuesForSku) { Sku matchingSku = null; List<Long> possibleSkuIds = new ArrayList<>(); for (Map.Entry<String, String> entry : MapUtils.emptyIfNull(attributeValuesForSku).entrySet()) { possibleSkuIds = productOptionValidationService.findSkuIdsForProductOptionValues(product.getId(), entry.getKey(), entry.getValue(), possibleSkuIds); if (CollectionUtils.isEmpty(possibleSkuIds)) { break; } } if (CollectionUtils.isNotEmpty(possibleSkuIds)) { matchingSku = catalogService.findSkuById(possibleSkuIds.iterator().next()); } return matchingSku; }
if (CollectionUtils.isNotEmpty(ip4Answers)) { singleValue = ip4Answers.get(0).ipAddress(); } else if (CollectionUtils.isNotEmpty(ip6Answers)) { singleValue = ip6Answers.get(0).ipAddress(); } else { if (StringUtils.isNotBlank(singleValue)) { builder.single(singleValue); allAnswers.addAll(ip6Answers); if (CollectionUtils.isNotEmpty(allAnswers)) { builder.multiValue(Collections.singletonMap(RESULTS_FIELD, allAnswers));
processorDetails.setType(StringUtils.substringAfterLast(processor.getType(), ".")); final String relationships = CollectionUtils.isEmpty(connection.getSelectedRelationships()) ? StringUtils.EMPTY : StringUtils.join(connection.getSelectedRelationships(), ", "); final String name = StringUtils.isBlank(connection.getName()) ? relationships : connection.getName();
@Override public MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, Parameters params) { Swagger swagger = params.swagger; if (isNotBlank(swagger.getHost()) || isNotBlank(swagger.getBasePath()) || isNotEmpty(swagger.getSchemes())) { markupDocBuilder.sectionTitleLevel(params.titleLevel, labels.getLabel(Labels.URI_SCHEME)); MarkupDocBuilder paragraphBuilder = copyMarkupDocBuilder(markupDocBuilder); if (isNotBlank(swagger.getHost())) { paragraphBuilder.italicText(labels.getLabel(Labels.HOST)) .textLine(COLON + swagger.getHost()); } if (isNotBlank(swagger.getBasePath())) { paragraphBuilder.italicText(labels.getLabel(Labels.BASE_PATH)) .textLine(COLON + swagger.getBasePath()); } if (isNotEmpty(swagger.getSchemes())) { List<String> schemes = swagger.getSchemes().stream() .map(Enum::toString) .collect(Collectors.toList()); paragraphBuilder.italicText(labels.getLabel(Labels.SCHEMES)) .textLine(COLON + join(schemes, ", ")); } markupDocBuilder.paragraph(paragraphBuilder.toString(), true); } return markupDocBuilder; }
String name = connection.getName(); final Collection<Relationship> relationships = connection.getRelationships(); if (StringUtils.isBlank(name) && CollectionUtils.isNotEmpty(relationships)) { name = StringUtils.join(relationships.stream().map(Relationship::getName).collect(Collectors.toSet()), ", ");
if(!CollectionUtils.isEmpty(criteria.getProductIds())) { countBuilderWhere.append(" and p.id in (:pId)"); if(!CollectionUtils.isEmpty(criteria.getCategoryIds())) { countBuilderSelect.append(" INNER JOIN p.categories categs"); countBuilderWhere.append(" and categs.id in (:cid)"); if(!CollectionUtils.isEmpty(criteria.getAttributeCriteria())) { if(!CollectionUtils.isEmpty(criteria.getCategoryIds())) { countQ.setParameter("cid", criteria.getCategoryIds()); if(!CollectionUtils.isEmpty(criteria.getAttributeCriteria())) { int count = 0; for(AttributeCriteria attributeCriteria : criteria.getAttributeCriteria()) { if(!CollectionUtils.isEmpty(criteria.getProductIds())) { countQ.setParameter("pId", criteria.getProductIds()); if(!CollectionUtils.isEmpty(criteria.getAttributeCriteria())) { qs.append(" inner join p.attributes pattr"); qs.append(" inner join pattr.productOption po"); if(!CollectionUtils.isEmpty(criteria.getProductIds())) { qs.append(" and p.id in (:pId)"); if(!CollectionUtils.isEmpty(criteria.getCategoryIds())) { qs.append(" and categs.id in (:cid)");
if (config.isFlatBodyEnabled()) { List<Parameter> parameters = operation.getOperation().getParameters(); 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));
if(StringUtils.isBlank(delivery.getPostalCode())) { shippingQuote.getWarnings().add("No postal code in delivery address"); shippingQuote.setShippingReturnCode(ShippingQuote.NO_POSTAL_CODE); if(!CollectionUtils.isEmpty(shippingModulePreProcessors)) { for(ShippingQuotePrePostProcessModule preProcessor : shippingModulePreProcessors) { if(shippingOptions==null && !StringUtils.isBlank(delivery.getPostalCode())) { option.setShippingModuleCode(moduleName); if(StringUtils.isBlank(option.getOptionName())) { if(!CollectionUtils.isEmpty(shippingModulePostProcessors)) { for(ShippingQuotePrePostProcessModule postProcessor : shippingModulePostProcessors) { if(shippingQuote!=null && CollectionUtils.isNotEmpty(shippingQuote.getShippingOptions())) {
public Map<String, List<InstanceEntity>> getInstanceMap(List<String> groups) { List<String> services = getServices(); Map<String, List<InstanceEntity>> instanceMap = new LinkedHashMap<String, List<InstanceEntity>>(services.size()); for (String service : services) { List<InstanceEntity> instanceEntityList = getInstanceList(service); if (CollectionUtils.isNotEmpty(groups)) { for (InstanceEntity instance : instanceEntityList) { String plugin = InstanceEntityWrapper.getPlugin(instance); String group = InstanceEntityWrapper.getGroup(instance); if (StringUtils.isNotEmpty(plugin) && groups.contains(group)) { List<InstanceEntity> instanceList = instanceMap.get(service); if (instanceList == null) { instanceList = new ArrayList<InstanceEntity>(); instanceMap.put(service, instanceList); } instanceList.add(instance); } } } else { instanceMap.put(service, instanceEntityList); } } return instanceMap; }
protected void addPromotionMessagesForType(List<PromotionMessageDTO> messageDTOs, List<PromotionMessageDTO> messages) { if (CollectionUtils.isNotEmpty(messages)) { messageDTOs.addAll(messages); } }
public DiscoverySearchFilter getSearchFilter(String name) { for (DiscoverySearchFilter filter : CollectionUtils.emptyIfNull(searchFilters)) { if (StringUtils.equals(name, filter.getIndexFieldName())) { return filter; } } return null; }
/** * Null-safe check if the specified collection is not empty. * <p> * Null returns false. * * @param coll the collection to check, may be null * @return true if non-null and non-empty * @since 3.2 */ public static boolean isNotEmpty(final Collection<?> coll) { return !isEmpty(coll); }
private int getWeight(String consumerServiceId, String providerServiceId, String providerVersion, Map<String, List<WeightEntity>> weightEntityMap) { if (MapUtils.isEmpty(weightEntityMap)) { return -1; } List<WeightEntity> weightEntityList = weightEntityMap.get(consumerServiceId); if (CollectionUtils.isEmpty(weightEntityList)) { return -1; } for (WeightEntity weightEntity : weightEntityList) { String providerServiceName = weightEntity.getProviderServiceName(); if (StringUtils.equalsIgnoreCase(providerServiceName, providerServiceId)) { Map<String, Integer> weightMap = weightEntity.getWeightMap(); if (MapUtils.isEmpty(weightMap)) { return -1; } Integer weight = weightMap.get(providerVersion); if (weight != null) { return weight; } else { return -1; } } } return -1; }
protected boolean equalCollections(Collection<V> a, Collection<V> b) { if (CollectionUtils.isEmpty(a) && CollectionUtils.isEmpty(b)) { return true; } if ((CollectionUtils.isEmpty(a) && CollectionUtils.isNotEmpty(b)) || (CollectionUtils.isNotEmpty(a) && CollectionUtils.isEmpty(b))) { return false; } return CollectionUtils.isEqualCollection(a, b); }
/** * Gets the bundle for the bundle name, prefix, and file list if previously used on this request. * <p> * Note that the mapping prefix and file list will be assumed to be the same if not provided. * @param name the name of the bundle to search for * @param mappingPrefix the mapping prefix of the bundle request, or null if not provided * @param files the list of files of the bundle request, or null if not provided * @return the bundle request if found, otherwise null */ public ResourcesRequestBundle getBundle(@Nonnull String name, String mappingPrefix, List<String> files) { for (ResourcesRequestBundle resourcesRequestBundle : bundlesRequested) { //names are same if (name.equals(resourcesRequestBundle.getBundleName())) { if (!StringUtils.equalsIgnoreCase(mappingPrefix, resourcesRequestBundle.getMappingPrefix())) { //the prefixes are different continue; } final List<String> bundleFiles = resourcesRequestBundle.getFiles(); if (!CollectionUtils.isEqualCollection(files, bundleFiles)) { //files are different continue; } return resourcesRequestBundle; } } return null; }