CollectionUtils.removeAll(columnfamilies, excludeCFFilter);
public static void checkClass(Map<String, ClassCode> classCodes) { Set<String> allClass = allClass(classCodes); Set<String> classCodeNames = classCodes.values().stream().map(classCode -> classCode.name).collect(Collectors.toSet()); Collection<String> classes = CollectionUtils.removeAll(allClass, classCodeNames); Collection<String> classes1 = CollectionUtils.removeAll(classes, Arrays.asList(ProgramConstants.SDK_CLASS_NAMES)); Collection<String> classes2 = CollectionUtils.removeAll(classes1, Arrays.asList(ProgramConstants.CONTRACT_USED_CLASS_NAMES)); Collection<String> classes3 = CollectionUtils.removeAll(classes2, Arrays.asList(ProgramConstants.CONTRACT_LAZY_USED_CLASS_NAMES)); if (classes3.size() > 0) { throw new RuntimeException(String.format("can't use classes: %s", Joiner.on(", ").join(classes3))); } }
/** * Check the given parameters do not overrides a valued parameter. */ private void checkOverrides(final List<String> acceptedParameters, final List<String> parameters) { final Collection<String> overrides = CollectionUtils.removeAll(parameters, acceptedParameters); if (!overrides.isEmpty()) { // A non acceptable parameter. An attempt to override a secured data? throw ValidationJsonException.newValidationJsonException("not-accepted-parameter", overrides.iterator().next()); } }
/** * Remove images with the given set of {@link Tag}s from this SearchResult. * * @param tags Tags to remove. */ public void filter(final Tag... tags) { // Don't waste time filtering against an empty array. if (tags == null || tags.length == 0) { return; } // Don't filter tags searched for by the user. final Collection<Tag> tagList = CollectionUtils.removeAll(Arrays.asList(tags), Arrays.asList(query)); // Remove images containing filtered tags. CollectionUtils.filter(images, new Predicate<Image>() { @Override public boolean evaluate(Image image) { return !CollectionUtils.containsAny(Arrays.asList(image.tags), tagList); } }); reorderImagePageOffsets(); }
/** * Update the given node parameter values. The old not updated values are deleted. * * @param values * the parameter values to persist. * @param node * The related node. */ public void update(final List<ParameterValueCreateVo> values, final Node node) { // Build the old parameter values final List<ParameterValue> oldList = repository.getParameterValues(node.getId()); final Map<String, ParameterValue> oldMap = oldList.stream() .collect(Collectors.toMap(v -> v.getParameter().getId(), Function.identity())); // Build the target parameter values final Set<String> newParam = values.stream().map(v -> saveOrUpdate(oldMap, v)).filter(Objects::nonNull) .peek(v -> v.setNode(node)).map(repository::saveAndFlush).map(v -> v.getParameter().getId()) .collect(Collectors.toSet()); // Delete the existing but not provided values CollectionUtils.removeAll(oldMap.keySet(), newParam).stream().map(oldMap::get).forEach(repository::delete); cacheManager.getCache("node-parameters").evict(node.getId()); }
@Override public void ungroupByColumns(String... columnIds) { checkNotNullArgument(columnIds); if (uselessGrouping(columnIds)) { return; } Object[] remainingGroups = CollectionUtils .removeAll(component.getGroupProperties(), collectPropertiesByColumns(columnIds)) .toArray(); groupBy(remainingGroups); }