
com.github.nikita_volkov.java.iterables.MappingIterable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iterables Show documentation
Show all versions of iterables Show documentation
Composable iterables for Java
package com.github.nikita_volkov.java.iterables;
import com.github.nikita_volkov.java.iterators.MappingIterator;
import java.util.Iterator;
import java.util.function.Function;
public final class MappingIterable implements Iterable {
private final Iterable initialIterable;
private final Function projection;
public MappingIterable(Iterable initialIterable, Function projection) {
this.initialIterable = initialIterable;
this.projection = projection;
}
@Override
public Iterator iterator() {
return new MappingIterator<>(initialIterable.iterator(), projection);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy