com.ibm.ia.global.jobs

Class JobParameter

  • java.lang.Object
    • com.ibm.ia.global.jobs.JobParameter
  • All Implemented Interfaces:
    com.ibm.ia.util.CISSerializable, java.io.Serializable


    public class JobParameter
    extends java.lang.Object
    implements com.ibm.ia.util.CISSerializable
    A parameter used to configure a job.

    The JobParameter value is stored as a string. The overloaded type constructors and getters are convenience methods to handle the string value as a particular primtitive type.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String PARAM_LOGICAL_NOW
      An optional parameter that can be use within a batch job to indicate logical now.
      static java.lang.String PARAM_TIMEOUT
      An optional job timeout parameter in milliseconds.
    • Constructor Summary

      Constructors 
      Constructor and Description
      JobParameter(java.lang.String key, boolean value)
      Creates a new JobParameter using the given key and boolean value.
      JobParameter(java.lang.String key, double value)
      Creates a new JobParameter using the given key and double value.
      JobParameter(java.lang.String key, int value)
      Creates a new JobParameter using the given key and int value.
      JobParameter(java.lang.String key, long value)
      Creates a new JobParameter using the given key and long value.
      JobParameter(java.lang.String key, java.lang.String value)
      Creates a new JobParameter using the given key and string value.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj) 
      java.lang.String getKey()
      Returns the key of this job parameter.
      java.lang.String getValue()
      Returns the value of this job paramter as a string.
      boolean getValueAsBoolean()
      Returns the value of this job parameter as a boolean.
      double getValueAsDouble()
      Returns the value of this job parameter as a double.
      int getValueAsInt()
      Returns the value of this job parameter as an int.
      long getValueAsLong()
      Returns the value of this job parameter as a long.
      int hashCode() 
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • PARAM_TIMEOUT

        public static final java.lang.String PARAM_TIMEOUT
        An optional job timeout parameter in milliseconds. If set, the parameter value trumps the default job timeout that can be set for jobs using solution or config properties.
        See Also:
        Constant Field Values
      • PARAM_LOGICAL_NOW

        public static final java.lang.String PARAM_LOGICAL_NOW
        An optional parameter that can be use within a batch job to indicate logical now. The value must be parsable by ZonedDateTime.parse(String).
        See Also:
        Constant Field Values
    • Constructor Detail

      • JobParameter

        @ConstructorProperties(value={"key","value"})
        public JobParameter(java.lang.String key,
                                          java.lang.String value)
        Creates a new JobParameter using the given key and string value.
        Parameters:
        key - The key of this job parameter.
        value - The value of this job parameter as a string.
      • JobParameter

        public JobParameter(java.lang.String key,
                    long value)
        Creates a new JobParameter using the given key and long value.
        Parameters:
        key - The key of this job parameter.
        value - The value of this job parameter as a long.
      • JobParameter

        public JobParameter(java.lang.String key,
                    double value)
        Creates a new JobParameter using the given key and double value.
        Parameters:
        key - The key of this job parameter.
        value - The value of this job parameter as a double.
      • JobParameter

        public JobParameter(java.lang.String key,
                    int value)
        Creates a new JobParameter using the given key and int value.
        Parameters:
        key - The key of this job parameter.
        value - The value of this job parameter as an int.
      • JobParameter

        public JobParameter(java.lang.String key,
                    boolean value)
        Creates a new JobParameter using the given key and boolean value.
        Parameters:
        key - The key of this job parameter.
        value - The value of this job parameter as a boolean.
    • Method Detail

      • getKey

        public java.lang.String getKey()
        Returns the key of this job parameter.
        Returns:
        The key of the job parameter.
      • getValue

        public java.lang.String getValue()
        Returns the value of this job paramter as a string.
        Returns:
        The value of this parameter as a string.
      • getValueAsInt

        public int getValueAsInt()
        Returns the value of this job parameter as an int. If the value cannot be parsed, 0 is returned.
        Returns:
        The int value of this job parameter.
      • getValueAsLong

        public long getValueAsLong()
        Returns the value of this job parameter as a long. If the value cannot be parsed, 0 is returned.
        Returns:
        The long value of this job parameter.
      • getValueAsDouble

        public double getValueAsDouble()
        Returns the value of this job parameter as a double. If the value cannot be parsed, 0 is returned.
        Returns:
        The double value of this job parameter.
      • getValueAsBoolean

        public boolean getValueAsBoolean()
        Returns the value of this job parameter as a boolean.
        Returns:
        The boolean value of this job parameter.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object

© Copyright IBM 2017