Package org.jppf.job

Class IsOneOfJobSelector

java.lang.Object
org.jppf.job.IsOneOfJobSelector
All Implemented Interfaces:
Serializable, JobSelector

public class IsOneOfJobSelector extends Object
Performs an "is one of" comparison between a job metadata value or a job name and a set of other comparable values.
Since:
6.2
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • IsOneOfJobSelector

      public IsOneOfJobSelector(String... values)
      Initialize this selector with an array of values to compare job names with.
      This constructor is equivalent to calling new IsOneOfJobSelector(null, Arrays.asList(values)).
      Parameters:
      values - the alues to compare with.
    • IsOneOfJobSelector

      public IsOneOfJobSelector(Collection<String> values)
      Initialize this selector with a collection of values to compare job names with.
      This constructor is equivalent to calling new IsOneOfJobSelector(null, values).
      Parameters:
      values - the alues to compare with.
    • IsOneOfJobSelector

      public IsOneOfJobSelector(Object key, Object... values)
      Initialize this selector with a job metadata key and an array of values to compare with.
      This constructor is equivalent to calling new IsOneOfJobSelector(key, values).
      Parameters:
      key - the metadata key of the value to compare with.
      values - the values to compare with.
    • IsOneOfJobSelector

      public IsOneOfJobSelector(Object key, Collection<?> values)
      Initialize this selector with a job metadata key and a collection of values to compare with.
      Parameters:
      key - the metadata key of the value to compare with.
      values - the values to compare with.
  • Method Details

    • accepts

      public boolean accepts(JPPFDistributedJob job)
      Description copied from interface: JobSelector
      Determine whether the specified job is accepted by this selector.
      Parameters:
      job - the job to check.
      Returns:
      true if the job is acepted, false otherwise.
    • hashCode

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

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