Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2006-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
import org.springframework.batch.core.explore.JobExplorer;
import org.springframework.util.Assert;
/**
* Helper class for creating {@link JobParameters}. Useful because all
* {@link JobParameter} objects are immutable, and must be instantiated separately
* to ensure type safety. Once created, it can be used in the
* same was a java.lang.StringBuilder (except, order is irrelevant), by adding
* various parameter types and creating a valid {@link JobParameters} once
* finished.
*
* Using the identifying flag indicates if the parameter will be used
* in the identification of a JobInstance. That flag defaults to true.
*
* @author Lucas Ward
* @author Michael Minella
* @author Glenn Renfro
* @author Mahmoud Ben Hassine
* @since 1.0
* @see JobParameters
* @see JobParameter
*/
public class JobParametersBuilder {
private Map parameterMap;
private JobExplorer jobExplorer;
/**
* Default constructor. Initializes the builder with empty parameters.
*/
public JobParametersBuilder() {
this.parameterMap = new LinkedHashMap<>();
}
/**
* @param jobExplorer {@link JobExplorer} used for looking up previous job parameter information
*/
public JobParametersBuilder(JobExplorer jobExplorer) {
this.jobExplorer = jobExplorer;
this.parameterMap = new LinkedHashMap<>();
}
/**
* Copy constructor. Initializes the builder with the supplied parameters.
* @param jobParameters {@link JobParameters} instance used to initialize the builder.
*/
public JobParametersBuilder(JobParameters jobParameters) {
this(jobParameters, null);
}
/**
* Constructor to add conversion capabilities to support JSR-352. Per the spec, it is expected that all
* keys and values in the provided {@link Properties} instance are Strings
*
* @param properties the job parameters to be used
*/
public JobParametersBuilder(Properties properties) {
this.parameterMap = new LinkedHashMap<>();
if(properties != null) {
for (Map.Entry