Open reschke opened 1 month ago
Thanks. We may do this eventually for at least some of our APIs. (previously: https://github.com/google/guava/issues/2758)
Some things we'd want to consider:
Function
extends the JDK Function
there (as it already does in the JRE flavor). Otherwise, calls that pass lambdas would become ambiguous.transform
and filter
methods in favor of Stream
nowadays. (We should really add a warning to Iterators
similar to the one on https://guava.dev/Iterables.) It would be somewhat sad to make some of the discouraged methods in Iterators
take up twice as much space in the Javadoc while leaving the handful that we still encourage alone.function::apply
to adapt back and forth. Still, it's clearly true that it would be better not to have to :)Thanks for the pointers. That makes it indeed easier.
Currently:
https://guava.dev/releases/snapshot-jre/api/docs/com/google/common/collect/Iterators.html#transform(java.util.Iterator,com.google.common.base.Function)
...would be good to relax that to
transform(java.util.Iterator,java.util.function.Function)
so it becomes easier to migrate away from Guava Function class.