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:
  • 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