Package org.springframework.batch.core

# Class JobParameter

java.lang.Object
org.springframework.batch.core.JobParameter

All Implemented Interfaces:
  `Serializable`

public class JobParameter extends Object implements Serializable
Domain representation of a parameter to a batch job. Only the following types can be parameters: String, Long, Date, and Double. The identifying flag is used to indicate if the parameter is to be used as part of the identification of a job instance.

Since:
  2.0
Author:
  Lucas Ward, Dave Syer, Michael Minella, Mahmoud Ben Hassine
See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `JobParameter.ParameterType`
  Enumeration representing the type of a JobParameter.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JobParameter(Double parameter)`
  Construct a new JobParameter as a Double.
  `JobParameter(Double parameter, boolean identifying)`
  Construct a new JobParameter as a Double.
  `JobParameter(Long parameter)`
  Construct a new JobParameter as a Long.
  `JobParameter(Long parameter, boolean identifying)`
  Construct a new JobParameter as a Long.
  `JobParameter(String parameter)`
  Construct a new JobParameter as a String.
  `JobParameter(String parameter, boolean identifying)`
  Construct a new JobParameter as a String.
  `JobParameter(Date parameter)`
  Construct a new JobParameter as a Date.
  `JobParameter(Date parameter, boolean identifying)`
  Construct a new JobParameter as a Date.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `JobParameter.ParameterType`
  `getType()`
  `Object`
  `getValue()`
  `int`
  `hashCode()`
  `boolean`
  `isIdentifying()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### JobParameter

    public JobParameter(@NonNull String parameter, boolean identifying)
    Construct a new JobParameter as a String.
    Parameters:
      `parameter` - `String` instance. Must not be `null`.
      `identifying` - true if JobParameter should be identifying.

  - ### JobParameter

    public JobParameter(@NonNull Long parameter, boolean identifying)
    Construct a new JobParameter as a Long.
    Parameters:
      `parameter` - `Long` instance. Must not be `null`.
      `identifying` - true if JobParameter should be identifying.

  - ### JobParameter

    public JobParameter(@NonNull Date parameter, boolean identifying)
    Construct a new JobParameter as a Date.
    Parameters:
      `parameter` - `Date` instance. Must not be `null`.
      `identifying` - true if JobParameter should be identifying.

  - ### JobParameter

    public JobParameter(@NonNull Double parameter, boolean identifying)
    Construct a new JobParameter as a Double.
    Parameters:
      `parameter` - `Double` instance. Must not be `null`.
      `identifying` - true if JobParameter should be identifying.

  - ### JobParameter

    public JobParameter(String parameter)
    Construct a new JobParameter as a String.
    Parameters:
      `parameter` - `String` instance.

  - ### JobParameter

    public JobParameter(Long parameter)
    Construct a new JobParameter as a Long.
    Parameters:
      `parameter` - `Long` instance.

  - ### JobParameter

    public JobParameter(Date parameter)
    Construct a new JobParameter as a Date.
    Parameters:
      `parameter` - `Date` instance.

  - ### JobParameter

    public JobParameter(Double parameter)
    Construct a new JobParameter as a Double.
    Parameters:
      `parameter` - `Double` instance.

- ## Method Details

  - ### isIdentifying

    public boolean isIdentifying()

  - ### getValue

    public Object getValue()
    Returns:
      the value contained within this JobParameter.

  - ### getType

    public JobParameter.ParameterType getType()
    Returns:
      a ParameterType representing the type of this parameter.

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`