
br.com.objectos.jabuticava.serasa.relato.factoring.TotalClienteParser 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 TotalClienteParser implements RecordMatcher, RecordParser {
private static final TotalClienteParser INSTANCE = new TotalClienteParser();
private static final String id = "01";
private static final String brancos = " ";
private TotalClienteParser() {
}
public static RecordParser get() {
return INSTANCE;
}
public static RecordMatcher getMatcher() {
return INSTANCE;
}
@Override
public boolean matches(String line) {
return line != null ? line.startsWith("01") : false;
}
@Override
public TotalCliente parse(FlatFileReader file) throws RecordParseException {
Record record = file.recordReader()
.fixed(id)
.integer(6)
.fixed(brancos)
.read();
if (!record.valid()) {
throw record.parseException();
}
return new TotalClienteBuilderPojo()
.quantidade(record.intValue())
.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy