import org.springframework.batch.item.file.transform.FieldSet;
public class LeadFieldSetMapper implements FieldSetMapper<Lead> {
public Lead mapFieldSet(FieldSet fieldSet) {
Lead lead = new Lead(fieldSet.readLong("id"), new Client(fieldSet.readString("client.name"), fieldSet
.readString("client.country")), new Product(fieldSet.readString("product.name")));
lead.setAmount(fieldSet.readDouble("amount"));
lead.setQuery(fieldSet.readString("query"));
return lead;
}