
br.com.objectos.jabuticava.serasa.relato.factoring.ProcessamentoParser Maven / Gradle / Ivy
The newest version!
package br.com.objectos.jabuticava.serasa.relato.factoring;
import br.com.objectos.way.io.flat.FlatFileReader;
import br.com.objectos.way.io.flat.Record;
import br.com.objectos.way.io.flat.RecordMatcher;
import br.com.objectos.way.io.flat.RecordParseException;
import br.com.objectos.way.io.flat.RecordParser;
import javax.annotation.Generated;
@Generated("br.com.objectos.way.io.flat.FlatRecordPlugin")
final class ProcessamentoParser implements RecordMatcher, RecordParser {
private static final ProcessamentoParser INSTANCE = new ProcessamentoParser();
private static final String id = "77";
private ProcessamentoParser() {
}
public static RecordParser get() {
return INSTANCE;
}
public static RecordMatcher getMatcher() {
return INSTANCE;
}
@Override
public boolean matches(String line) {
return line != null ? line.startsWith("77") : false;
}
@Override
public Processamento parse(FlatFileReader file) throws RecordParseException {
Record record = file.recordReader()
.fixed(id)
.text(2)
.text(186)
.read();
if (!record.valid()) {
throw record.parseException();
}
return new ProcessamentoBuilderPojo()
.numero(record. get())
.mensagem(record. get())
.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy