Class JobUpdater


  • public class JobUpdater
    extends java.lang.Object

    Provides a job value object updater class.

    Examples

    Please find the job updater examples below.

    Remove and Add a Job Property

    This Groovy example shows how to update a job by removing and adding a jobProperty.

     import com.avoka.tm.svc.*
     import com.avoka.tm.vo.*
    
     new JobUpdater(job)
         .removeJobProperty("fav food")
         .setJobProperty("sport","cycling")
         .update() 
    Since:
    17.10.0
    • Constructor Summary

      Constructors 
      Constructor Description
      JobUpdater()
      Create a job updater.
      JobUpdater​(Job job)
      Create a job updater setting the job to update.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JobUpdater removeProperty​(java.lang.String name)
      Specify the property to remove from the job.
      JobUpdater setId​(java.lang.Long id)
      Set the id of the job to update.
      JobUpdater setProperty​(java.lang.String name, java.lang.String value)
      Specify the property name and value to add or update on the job.
      void update()
      Update the identified job with the specified parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JobUpdater

        public JobUpdater()
        Create a job updater.
      • JobUpdater

        public JobUpdater​(Job job)
        Create a job updater setting the job to update.
        Parameters:
        job - the Job to update.
    • Method Detail

      • setId

        public JobUpdater setId​(java.lang.Long id)
        Set the id of the job to update.
        Parameters:
        id - the id (Long) of the job to update
        Returns:
        the job updater
      • setProperty

        public JobUpdater setProperty​(java.lang.String name,
                                      java.lang.String value)
        Specify the property name and value to add or update on the job.
        Parameters:
        name - the property name (required)
        value - the property value (required)
        Returns:
        the job updater
      • removeProperty

        public JobUpdater removeProperty​(java.lang.String name)
        Specify the property to remove from the job.
        Parameters:
        name - the property name to remove (required)
        Returns:
        the job updater
      • update

        public void update()
        Update the identified job with the specified parameters.