org.infinispan.stream.impl.intops.object.FlatMapToLongOperation Maven / Gradle / Ivy
package org.infinispan.stream.impl.intops.object;
import org.infinispan.stream.impl.intops.IntermediateOperation;
import java.util.function.Function;
import java.util.stream.LongStream;
import java.util.stream.Stream;
/**
* Performs flat map to long operation on a regular {@link Stream}
* @param the type of the input stream
*/
public class FlatMapToLongOperation implements IntermediateOperation, Long, LongStream> {
private final Function super I, ? extends LongStream> function;
public FlatMapToLongOperation(Function super I, ? extends LongStream> function) {
this.function = function;
}
@Override
public LongStream perform(Stream stream) {
return stream.flatMapToLong(function);
}
public Function super I, ? extends LongStream> getFunction() {
return function;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy