public class JobParametersBuilder extends Object
JobParameters
. Useful because all
JobParameter
objects are immutable, and must be instantiated separately
to ensure typesafety. 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 JobParameters
once
finished.JobParameters
,
JobParameter
Constructor and Description |
---|
JobParametersBuilder()
Default constructor.
|
JobParametersBuilder(JobParameters jobParameters)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
JobParametersBuilder |
addDate(String key,
Date parameter)
Add a new identifying
Date parameter for the given key. |
JobParametersBuilder |
addDate(String key,
Date parameter,
boolean identifying)
Add a new
Date parameter for the given key. |
JobParametersBuilder |
addDouble(String key,
Double parameter)
Add a new identifying Double parameter for the given key.
|
JobParametersBuilder |
addDouble(String key,
Double parameter,
boolean identifying)
Add a new Double parameter for the given key.
|
JobParametersBuilder |
addLong(String key,
Long parameter)
Add a new identifying Long parameter for the given key.
|
JobParametersBuilder |
addLong(String key,
Long parameter,
boolean identifying)
Add a new Long parameter for the given key.
|
JobParametersBuilder |
addParameter(String key,
JobParameter jobParameter)
Add a new
JobParameter for the given key. |
JobParametersBuilder |
addString(String key,
String parameter)
Add a new identifying String parameter for the given key.
|
JobParametersBuilder |
addString(String key,
String parameter,
boolean identifying)
Add a new String parameter for the given key.
|
JobParameters |
toJobParameters()
Conversion method that takes the current state of this builder and
returns it as a JobruntimeParameters object.
|
public JobParametersBuilder()
public JobParametersBuilder(JobParameters jobParameters)
public JobParametersBuilder addString(String key, String parameter)
key
- - parameter accessor.parameter
- - runtime parameterpublic JobParametersBuilder addString(String key, String parameter, boolean identifying)
key
- - parameter accessor.parameter
- - runtime parameteridentifying
- - indicates if the parameter is used as part of identifying a job instancepublic JobParametersBuilder addDate(String key, Date parameter)
Date
parameter for the given key.key
- - parameter accessor.parameter
- - runtime parameterpublic JobParametersBuilder addDate(String key, Date parameter, boolean identifying)
Date
parameter for the given key.key
- - parameter accessor.parameter
- - runtime parameteridentifying
- - indicates if the parameter is used as part of identifying a job instancepublic JobParametersBuilder addLong(String key, Long parameter)
key
- - parameter accessor.parameter
- - runtime parameterpublic JobParametersBuilder addLong(String key, Long parameter, boolean identifying)
key
- - parameter accessor.parameter
- - runtime parameteridentifying
- - indicates if the parameter is used as part of identifying a job instancepublic JobParametersBuilder addDouble(String key, Double parameter)
key
- - parameter accessor.parameter
- - runtime parameterpublic JobParametersBuilder addDouble(String key, Double parameter, boolean identifying)
key
- - parameter accessor.parameter
- - runtime parameteridentifying
- - indicates if the parameter is used as part of identifying a job instancepublic JobParameters toJobParameters()
JobParameters
object.public JobParametersBuilder addParameter(String key, JobParameter jobParameter)
JobParameter
for the given key.key
- - parameter accessorjobParameter
- - runtime parameterCopyright © 2014 Pivotal. All rights reserved.