Example usage for org.springframework.batch.item ExecutionContext getDouble

List of usage examples for org.springframework.batch.item ExecutionContext getDouble

Introduction

In this page you can find the example usage for org.springframework.batch.item ExecutionContext getDouble.

Prototype

public double getDouble(String key, double defaultDouble) 

Source Link

Document

Typesafe Getter for the Double represented by the provided key with default value to return if key is not represented.

Usage

From source file:be.ordina.springbatch.batch.writer.FineInformationWriter.java

private void upTheTally(Fine fine) {
    ExecutionContext executionContext = stepExecution.getExecutionContext();
    executionContext.put(fine.getLicensePlate().getType().name(),
            executionContext.getInt(fine.getLicensePlate().getType().name(), 0) + 1);
    executionContext.put("total", executionContext.getDouble("total", 0L) + fine.getAmountToPay());
    if (fine.isGraveError()) {
        executionContext.put("graveErrors", executionContext.getInt("graveErrors", 0) + 1);
    }//from w w w.  j  a v  a 2  s  .  c o m
}