Google guava and error i can't understand

I get this error when trying to compile:

A method filter(Iterable<T>, Predicate<? super T>)in the Iterables type is not applicable for arguments ( Iterator<PeopleSoftBalance>, ColumnLikePredicate<PeopleSoftBalance>)

Here is the ColumnLikePredicate sig class:

public class ColumnLikePredicate<T extends RowModel> implements Predicate<T>

What am I doing wrong?

+3
source share
3 answers

It looks like you are passing to the Iteratormethod that is expecting Iterable.

Iterator :

Iterator over set

Iterable :

Implementing this interface allows an object to be an object of a foreach statement.

Iteratoris an object that can be used to iterate over a (different) collection. Iterableis an object that can be repeated.

, collection, - Iterables.filter(collection.iterator(), predicate). Iterables , Iterable, :

Iterables.filter(collection, predicate)
+14

, Guava Iterators.filter() Iterables.filter(). Iterator Iterable.

+3

Does PeopleSoftBalance RowModel support?

0
source

Source: https://habr.com/ru/post/1759047/


All Articles