Example usage for org.springframework.batch.core JobParameters getLong

List of usage examples for org.springframework.batch.core JobParameters getLong

Introduction

In this page you can find the example usage for org.springframework.batch.core JobParameters getLong.

Prototype

@Nullable
public Long getLong(String key, @Nullable Long defaultValue) 

Source Link

Document

Typesafe Getter for the Long represented by the provided key.

Usage

From source file:fr.acxio.tools.agia.common.RunIdIncrementer.java

public JobParameters getNext(JobParameters sParameters) {
    if ((sParameters == null) || sParameters.isEmpty()) {
        return new JobParametersBuilder().addLong(RUN_ID, RUN_ID_DEFAULT).toJobParameters();
    }//from   ww w .j a  va  2s .  c o m
    long aId = sParameters.getLong(RUN_ID, RUN_ID_DEFAULT) + 1;
    return new JobParametersBuilder().addLong(RUN_ID, aId).toJobParameters();
}