[java-support] branch master updated: Remove unused removeIf helper methods.
Scott Cantor
cantor.2 at osu.edu
Fri Nov 1 16:17:00 EDT 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-support.
View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=0bad770f58d56af540bdfcc2702396bb1c98ead4
The following commit(s) were added to refs/heads/master by this push:
new 0bad770 Remove unused removeIf helper methods.
0bad770 is described below
commit 0bad770f58d56af540bdfcc2702396bb1c98ead4
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Nov 1 16:16:58 2019 -0400
Remove unused removeIf helper methods.
---
.../java/support/collection/CollectionSupport.java | 88 ----------------------
1 file changed, 88 deletions(-)
diff --git a/src/main/java/net/shibboleth/utilities/java/support/collection/CollectionSupport.java b/src/main/java/net/shibboleth/utilities/java/support/collection/CollectionSupport.java
index bc93eb7..dc7df66 100644
--- a/src/main/java/net/shibboleth/utilities/java/support/collection/CollectionSupport.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/collection/CollectionSupport.java
@@ -121,92 +121,4 @@ public final class CollectionSupport {
return targetedUpdated;
}
- /**
- * Removes an element to a collection if it meets the requirements of a given predicate.
- *
- * @param <T> type of element in the collection
- * @param target collection to which elements will be removed
- * @param element element that may be removed from the collection
- * @param predicate predicate the given element must meet in order to be removed from the given collection
- *
- * @return true if the given element was removed from the given collection
- */
- public static <T> boolean removeIf(@Nonnull final Collection<T> target, @Nullable final T element,
- @Nonnull final Predicate<? super T> predicate) {
- return removeIf(target, element, predicate, t -> t);
- }
-
- /**
- * Removes an element to a collection if it meets the requirements of a given predicate.
- *
- * @param <T> type of element in the collection
- * @param target collection to which elements will be removed
- * @param element element that may be removed from the collection
- * @param predicate predicate the given element must meet in order to be removed from the given collection
- * @param elementPreprocessor function applied to element prior to predicate evaluation and being removed from the
- * collection
- *
- * @return true if the given element was added to the given collection
- */
- public static <T> boolean removeIf(@Nonnull final Collection<T> target, @Nullable final T element,
- @Nonnull final Predicate<? super T> predicate, @Nonnull final Function<? super T, T> elementPreprocessor) {
- Constraint.isNotNull(target, "Target collection can not be null");
- Constraint.isNotNull(predicate, "Element predicate can not be null");
-
- if (element != null) {
- return false;
- }
-
- final T processedElement = elementPreprocessor.apply(element);
- if (predicate.test(processedElement)) {
- return target.remove(processedElement);
- }
-
- return false;
- }
-
- /**
- * Removes a collection of elements to a collection for each element that meets the requirements of a given
- * predicate.
- *
- * @param <T> type of element in the collection
- * @param target collection to which elements will be removed
- * @param elements elements that may be removed from the collection
- * @param predicate predicate the given element must meet in order to be removed from the given collection
- *
- * @return true if the given target had elements added to it
- */
- public static <T> boolean removeIf(@Nonnull final Collection<T> target, @Nullable final Collection<T> elements,
- @Nonnull final Predicate<? super T> predicate) {
- return removeIf(target, elements, predicate, t -> t);
- }
-
- /**
- * Removes a collection of elements to a collection for each element that meets the requirements of a given
- * predicate.
- *
- * @param <T> type of element in the collection
- * @param target collection to which elements will be removed
- * @param elements elements that may be removed from the collection
- * @param predicate predicate the given element must meet in order to be removed from the given collection
- * @param elementPreprocessor function applied to element prior to predicate evaluation and being removed from the
- * collection
- *
- * @return true if the given target had elements added to it
- */
- public static <T> boolean removeIf(@Nonnull final Collection<T> target, @Nullable final Collection<T> elements,
- @Nonnull final Predicate<? super T> predicate, @Nonnull final Function<? super T, T> elementPreprocessor) {
- if (elements == null) {
- return false;
- }
-
- boolean targetedUpdated = false;
- for (final T element : elements) {
- if (removeIf(target, element, predicate, elementPreprocessor)) {
- targetedUpdated = true;
- }
- }
-
- return targetedUpdated;
- }
}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list