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

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

package fun.mike.flapjack.pipeline.lab;

import fun.mike.flapjack.alpha.Format;

public class FlatOutputFilePipelineBuilder {
    private final InputContext inputContext;
    private final Transform transform;

    private final String outputPath;
    private final Format outputFormat;
    private Boolean includeHeader;

    public FlatOutputFilePipelineBuilder(InputContext inputContext, Transform transform, String outputPath, Format outputFormat, Boolean includeHeader) {
        this.inputContext = inputContext;
        this.transform = transform;
        this.outputPath = outputPath;
        this.outputFormat = outputFormat;
        this.includeHeader = includeHeader;
    }

    public FlatOutputFilePipelineBuilder includeHeader() {
        includeHeader = true;
        return this;
    }

    public FlatFilePipeline build() {
        FlatFileOutputContext outputFile = new FlatFileOutputContext(outputPath, outputFormat, includeHeader);
        return new FlatFilePipeline(inputContext, transform, outputFile);
    }

    public PipelineResult run() {
        return build().run();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy