/** * Removes all values associated with the specified key. * <p> * A subsequent <code>get(Object)</code> would return an empty set. * * @param key the key to remove values from * @return the <code>Set</code> of values removed, will return an empty, * unmodifiable set for no mapping found. */ @Override public Set<V> remove(final Object key) { return SetUtils.emptyIfNull(getMap().remove(key)); }
final SetView<E> aMinusB = difference(a, b); final SetView<E> bMinusA = difference(b, a);
private Set<String> getUnresolvedModules(List<ModuleToDeploy> modulesToDeploy, Set<String> deployedModules, Set<String> allMtaModules) { Set<String> resolvedModules = modulesToDeploy.stream() .map(ModuleToDeploy::getName) .collect(Collectors.toSet()); return SetUtils.difference(allMtaModules, SetUtils.union(resolvedModules, deployedModules)) .toSet(); }
/** * @return a Read-only view of the Modalities. */ public Set<String> getModalities() { return SetUtils.unmodifiableSet(modalitiesSet); }
public CollectionActionDispatcher(Collection<E> cache){ this.cache =cache; this.targets =SetUtils.newIdentityHashSet(); }
@TaskAction public void perform() { Packager packager = new Packager(fileUtils, gw7Builder); final Set<File> bundleDependencies = dependencyBundles.getAsFileTree().getFiles(); packager.buildPackage( into.getAsFile().get(), bundle.getAsFile().get(), filterBundleFiles(bundleDependencies), containerApplicationDependencies.getFiles(), union(dependencyModularAssertions.getFiles(), filterModularAssertionFiles(bundleDependencies)), union(dependencyCustomAssertions.getFiles(), filterJarFiles(bundleDependencies)) ); } }
public ApacheCommonsDeckOfCards() { this.cards = SetUtils.unmodifiableSortedSet( Card.streamCards().collect(Collectors.toCollection(TreeSet::new))); SetValuedMap<Suit, Card> cbs = MultiMapUtils.newSetValuedHashMap(); this.cards.forEach(card -> cbs.put(card.getSuit(), card)); this.cardsBySuit = MultiMapUtils.unmodifiableMultiValuedMap(cbs); }
private static void assertLocationMatches(List<LocationMatch> matches, int expectedCount, List<String> expectedNames) { if (CollectionUtils.isEmpty(matches)) { matches = Lists.newArrayList(); } assertEquals(matches.size(), expectedCount); Set<String> names = Sets.newHashSet(); for (LocationMatch locationMatch : matches) { names.add(locationMatch.getLocation().getName()); } assertTrue(SetUtils.isEqualSet(names, expectedNames)); }
private Set<String> getUnresolvedModules(List<Module> calculatedModules) { Set<String> calculatedModuleNames = calculatedModules.stream() .map(Module::getName) .collect(Collectors.toSet()); return SetUtils.difference(allMtaModules, SetUtils.union(calculatedModuleNames, deployedModules)) .toSet(); }
/** * Gets a read-only view of the DIM Fields * @return */ public Set<TagValue> getDIMFields(){ return SetUtils.unmodifiableSet(this.nDIMFields); }
Set<ProjectInitializer> initsDeferred = SetUtils.newIdentityHashSet();
private Set<String> getUnresolvedModules(List<ModuleToDeploy> modulesToDeploy, Set<String> deployedModules, Set<String> allMtaModules) { Set<String> resolvedModules = modulesToDeploy.stream() .map(ModuleToDeploy::getName) .collect(Collectors.toSet()); return SetUtils.difference(allMtaModules, SetUtils.union(resolvedModules, deployedModules)) .toSet(); }
protected List<ItemCriteriaDTO> buildItemCriteriaDTOList(StructuredContent sc) { List<ItemCriteriaDTO> itemCriteriaDTOList = new ArrayList<>(); Set<StructuredContentItemCriteria> qualifyingItemCriteria = SetUtils.emptyIfNull(sc.getQualifyingItemCriteria()); for (StructuredContentItemCriteria criteria : qualifyingItemCriteria) { ItemCriteriaDTO criteriaDTO = entityConfiguration.createEntityInstance(ItemCriteriaDTO.class.getName(), ItemCriteriaDTO.class); criteriaDTO.setMatchRule(criteria.getMatchRule()); criteriaDTO.setQty(criteria.getQuantity()); itemCriteriaDTOList.add(criteriaDTO); } return itemCriteriaDTOList; }
/** * @return a Read only view of the Private Fields */ public Set<TagValue> getPrivateFields(){ return SetUtils.unmodifiableSet(nPrivateFields); }
Set<ProjectInitializer> initsDeferred = SetUtils.newIdentityHashSet();
final SetView<E> bMinusA = difference(b, a);
protected void addProductOptionPricingToModel(Map<String, Object> newModelVars, Product product, BroadleafTemplateContext context, Map<String, String> tagAttributes) { List<Sku> skus = product.getSkus(); List<ProductOptionPricingDTO> skuPricing = new ArrayList<>(); for (Sku sku : skus) { List<Long> productOptionValueIds = new ArrayList<Long>(); Set<SkuProductOptionValueXref> productOptionValueXrefs = SetUtils.emptyIfNull(sku.getProductOptionValueXrefs()); for (SkuProductOptionValueXref skuProductOptionValueXref : productOptionValueXrefs) { ProductOptionValue productOptionValue = skuProductOptionValueXref.getProductOptionValue(); productOptionValueIds.add(productOptionValue.getId()); } ProductOptionPricingDTO pricingDto = createPricingDto(sku, productOptionValueIds, tagAttributes, context); skuPricing.add(pricingDto); } writeJSONToModel(newModelVars, "skuPricing", skuPricing); }
/** * @return a Read-only view of all fields. */ public Set<TagValue> getAllFields(){ return SetUtils.unmodifiableSet( new HashSet<>(tagValueMappings.values()) ); }
Set<ProjectExporter> initsDeferred = SetUtils.newIdentityHashSet();
/** * Converts a StructuredContent into a StructuredContentDTO. If the item contains fields with * broadleaf cms urls, the urls are converted to utilize the domain. * <p/> * The StructuredContentDTO is built via the {@link EntityConfiguration}. To override the actual type that is returned, * include an override in an applicationContext like any other entity override. * * @param sc * @param secure * @return */ @Override public StructuredContentDTO buildStructuredContentDTO(StructuredContent sc, boolean secure) { StructuredContentDTO scDTO = entityConfiguration.createEntityInstance(StructuredContentDTO.class.getName(), StructuredContentDTO.class); Set<StructuredContentItemCriteria> qualifyingItemCriteria = SetUtils.emptyIfNull(sc.getQualifyingItemCriteria()); scDTO.setContentName(sc.getContentName()); scDTO.setContentType(sc.getStructuredContentType().getName()); scDTO.setId(sc.getId()); scDTO.setPriority(sc.getPriority()); if (sc.getLocale() != null) { scDTO.setLocaleCode(sc.getLocale().getLocaleCode()); } scDTO.setRuleExpression(buildRuleExpression(sc)); buildFieldValues(sc, scDTO, secure); if (qualifyingItemCriteria.size() > 0) { scDTO.setItemCriteriaDTOList(buildItemCriteriaDTOList(sc)); } return scDTO; }