Deprecate Predicate in favor of java.util.function.Predicate

This commit is contained in:
Gary Gregory 2024-04-28 09:37:52 -04:00
parent e5c3d7ec12
commit c208c4adde
2 changed files with 9 additions and 2 deletions

View File

@ -28,6 +28,7 @@
<!-- FIX -->
<action type="update" dev="ggregory" due-to="Gary Gregory">Deprecate Closure in favor of java.util.function.Consumer.</action>
<action type="update" dev="ggregory" due-to="Gary Gregory">Deprecate Factory in favor of java.util.function.Supplier.</action>
<action type="update" dev="ggregory" due-to="Gary Gregory">Deprecate Predicate in favor of java.util.function.Predicate.</action>
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Dependabot">Bump org.apache.commons:commons-parent from 67 to 69 #473.</action>
<action type="update" dev="ggregory" due-to="Dependabot">Bump tests commons-io:commons-io from 2.16.0 to 2.16.1 #475 .</action>

View File

@ -33,9 +33,10 @@ package org.apache.commons.collections4;
* @param <T> the type that the predicate queries
*
* @since 1.0
* @deprecated Use {@link java.util.function.Predicate}.
*/
@FunctionalInterface
public interface Predicate<T> {
@Deprecated
public interface Predicate<T> extends java.util.function.Predicate<T> {
/**
* Use the specified parameter to perform a test that returns true or false.
@ -48,4 +49,9 @@ public interface Predicate<T> {
*/
boolean evaluate(T object);
@Override
default boolean test(final T t) {
return evaluate(t);
}
}