Example usage for org.springframework.batch.item.file.transform FieldSet readBoolean

List of usage examples for org.springframework.batch.item.file.transform FieldSet readBoolean

Introduction

In this page you can find the example usage for org.springframework.batch.item.file.transform FieldSet readBoolean.

Prototype

boolean readBoolean(String name);

Source Link

Document

Read the 'boolean' value from column with given 'name'.

Usage

From source file:com.sofrecom.batch.mapper.RegistrationFieldSetMapper.java

@Override
public RegistrationConfirmation mapFieldSet(FieldSet fieldSet) throws BindException {
    Integer contactId = fieldSet.readString(0) != null && !fieldSet.readString(0).isEmpty()
            ? fieldSet.readInt(0)//  w  ww.ja v a  2s  .  co m
            : null;
    Contact contact = new Contact(contactId, fieldSet.readString(1), fieldSet.readString(2),
            fieldSet.readString(4), fieldSet.readDate(3, "yyyy-MM-dd"));
    RegistrationConfirmation confirmation = new RegistrationConfirmation(contact, fieldSet.readBoolean(5),
            fieldSet.readDate(6));
    return confirmation;
}