mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
b404b11b0b
commit
66fe842140
@ -941,7 +941,7 @@ public class CollUtil {
|
|||||||
* @return 处理后的集合
|
* @return 处理后的集合
|
||||||
* @since 4.6.5
|
* @since 4.6.5
|
||||||
*/
|
*/
|
||||||
public static <T extends Collection<E>, E> T filter(final T collection, final Filter<E> filter) {
|
public static <T extends Collection<E>, E> T filter(final T collection, final Predicate<E> filter) {
|
||||||
return IterUtil.filter(collection, filter);
|
return IterUtil.filter(collection, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -710,7 +710,7 @@ public class IterUtil {
|
|||||||
* @return 编辑后的集合
|
* @return 编辑后的集合
|
||||||
* @since 4.6.5
|
* @since 4.6.5
|
||||||
*/
|
*/
|
||||||
public static <T extends Iterable<E>, E> T filter(final T iter, final Filter<E> filter) {
|
public static <T extends Iterable<E>, E> T filter(final T iter, final Predicate<E> filter) {
|
||||||
if (null == iter) {
|
if (null == iter) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -734,13 +734,13 @@ public class IterUtil {
|
|||||||
* @return 编辑后的集合
|
* @return 编辑后的集合
|
||||||
* @since 4.6.5
|
* @since 4.6.5
|
||||||
*/
|
*/
|
||||||
public static <E> Iterator<E> filter(final Iterator<E> iter, final Filter<E> filter) {
|
public static <E> Iterator<E> filter(final Iterator<E> iter, final Predicate<E> filter) {
|
||||||
if (null == iter || null == filter) {
|
if (null == iter || null == filter) {
|
||||||
return iter;
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
if (false == filter.accept(iter.next())) {
|
if (false == filter.test(iter.next())) {
|
||||||
iter.remove();
|
iter.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user