public boolean isMatch(T key) { return compareTo.equals(key); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((compareTo == null) ? 0 : compareTo.hashCode()); return result; }
@Override protected String getValue(T key) { return key.getName(); }
public Key getKey() { if(key == null) { key = new Key(getName(), getGroup()); } return key; }
@Override protected String getValue(T key) { return key.getGroup(); }
/** * Produce the <code>JobDetail</code> instance defined by this * <code>JobBuilder</code>. * * @return the defined JobDetail. */ public JobDetail build() { JobDetailImpl job = new JobDetailImpl(); job.setJobClass(jobClass); job.setDescription(description); if(key == null) key = new JobKey(Key.createUniqueName(null), null); job.setKey(key); job.setDurability(durability); job.setRequestsRecovery(shouldRecover); if(!jobDataMap.isEmpty()) job.setJobDataMap(jobDataMap); return job; }
/** * <p> * Get the name portion of the key. * </p> * * @return the name */ public String getName() { return (String) getFirst(); }
/** * <p> * Get the group portion of the key. * </p> * * @return the group */ public String getGroup() { return (String) getSecond(); }
@Override protected String getValue(T key) { return key.getName(); }
public Key getKey() { if(key == null) { key = new Key(getName(), getGroup()); } return key; }
@Override protected String getValue(T key) { return key.getGroup(); }
/** * Produce the <code>JobDetail</code> instance defined by this * <code>JobBuilder</code>. * * @return the defined JobDetail. */ public JobDetail build() { JobDetailImpl job = new JobDetailImpl(); job.setJobClass(jobClass); job.setDescription(description); if(key == null) key = new JobKey(Key.createUniqueName(null), null); job.setKey(key); job.setDurability(durability); job.setRequestsRecovery(shouldRecover); if(!jobDataMap.isEmpty()) job.setJobDataMap(jobDataMap); return job; }
/** * <p> * Get the name portion of the key. * </p> * * @return the name */ public String getName() { return (String) getFirst(); }
/** * <p> * Get the group portion of the key. * </p> * * @return the group */ public String getGroup() { return (String) getSecond(); }
/** * Add a chain mapping - when the Job identified by the first key completes * the job identified by the second key will be triggered. * * @param firstJob a Key with the name and group of the first job * @param secondJob a Key with the name and group of the follow-up job */ public void addJobChainLink(Key firstJob, Key secondJob) { if(firstJob == null || secondJob == null) { throw new IllegalArgumentException("Key cannot be null!"); } if(firstJob.getName() == null || secondJob.getName() == null) { throw new IllegalArgumentException("Key cannot have a null name!"); } chainLinks.put(firstJob, secondJob); }
public Key getKey() { if(key == null) { key = new Key(getName(), getGroup()); } return key; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; KeyMatcher<?> other = (KeyMatcher<?>) obj; if (compareTo == null) { if (other.compareTo != null) return false; } else if (!compareTo.equals(other.compareTo)) return false; return true; }