All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fun.mike.flapjack.pipeline.lab.ReduceOutputContext Maven / Gradle / Ivy

package fun.mike.flapjack.pipeline.lab;

import java.util.function.BiFunction;

import fun.mike.record.alpha.Record;

public class ReduceOutputContext implements OutputContext {
    private final T identityValue;
    private final BiFunction reducer;

    public ReduceOutputContext(T identityValue, BiFunction reducer) {
        this.identityValue = identityValue;
        this.reducer = reducer;
    }

    @Override
    public OutputChannel buildChannel() {
        return new ReduceOutputChannel<>(identityValue, reducer);
    }

    @Override
    public void accept(OutputContextVisitor visitor) {
        visitor.accept(this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy