-
-
Save phstudy/50dfe92b958c70bbb4260f5532d8717c to your computer and use it in GitHub Desktop.
Iterable transformation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.collections4.IterableUtils; | |
import java.util.function.Function; | |
public class Iterables { | |
public static <F, T> Iterable<T> map( | |
Iterable<F> iterable, | |
Function<F, T> mapper) { | |
return IterableUtils.transformedIterable(iterable, (x) -> mapper.apply(x)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment