Migrate toward java.util.function.Predicate
- Maintains binary and source compatibility
This commit is contained in:
parent
3618193221
commit
54acc7a5d7
|
@ -28,6 +28,7 @@ import java.util.List;
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import org.apache.commons.collections4.functors.EqualPredicate;
|
import org.apache.commons.collections4.functors.EqualPredicate;
|
||||||
import org.apache.commons.collections4.iterators.ArrayIterator;
|
import org.apache.commons.collections4.iterators.ArrayIterator;
|
||||||
|
@ -710,7 +711,7 @@ public class IteratorUtils {
|
||||||
* @throws NullPointerException if closure is null
|
* @throws NullPointerException if closure is null
|
||||||
* @since 4.1
|
* @since 4.1
|
||||||
*/
|
*/
|
||||||
public static <E> void forEach(final Iterator<E> iterator, final Closure<? super E> closure) {
|
public static <E> void forEach(final Iterator<E> iterator, final Consumer<? super E> closure) {
|
||||||
Objects.requireNonNull(closure, "closure");
|
Objects.requireNonNull(closure, "closure");
|
||||||
if (iterator != null) {
|
if (iterator != null) {
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
|
|
Loading…
Reference in New Issue