
kr.jm.metric.input.FileInput Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jm-metric Show documentation
Show all versions of jm-metric Show documentation
FieldMap Transformer From Various Formatted Data
package kr.jm.metric.input;
import kr.jm.metric.config.input.FileInputConfig;
import kr.jm.metric.data.Transfer;
import kr.jm.utils.helper.JMFiles;
import lombok.ToString;
import java.util.function.Consumer;
@ToString(callSuper = true)
public class FileInput extends AbstractInput {
public FileInput(FileInputConfig inputConfig) {
super(inputConfig);
}
@Override
protected void startImpl(Consumer> inputConsumer) {
JMFiles.getLineStream(this.inputConfig.getFilePath())
.map(this::newTransfer).forEach(inputConsumer);
}
public FileInput(String filePath) {
this(new FileInputConfig(filePath));
}
@Override
protected void closeImpl() {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy