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

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

Introduction

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

Prototype

int readInt(String name, int defaultValue);

Source Link

Document

Read the 'int' value from column with given 'name', using the supplied defaultValue if the field value is blank.

Usage

From source file:no.magott.training.ex1.SpursMatchFieldSetMapper.java

@Override
public SpursMatch mapFieldSet(FieldSet fieldSet) throws BindException {
    int matchId = fieldSet.readInt("MatchId", 0);
    String day = fieldSet.readString("Day");
    String competition = fieldSet.readString("Competition");
    String opposition = fieldSet.readString("Opposition");
    String venue = fieldSet.readString("Venue");
    String halfTimeScore = fieldSet.readString("HalfTimeScore");
    int spursGoals = fieldSet.readInt("SpursGoals", 0);
    int oppositionGoals = fieldSet.readInt("OppositionGoals", 0);
    Date date = fieldSet.readDate("Date", "MMM d, yyyy", null);

    return new SpursMatch(matchId, day, date, competition, opposition, venue, halfTimeScore, spursGoals,
            oppositionGoals);/*from ww w.  j av  a2  s  .c o m*/
}