Java Code Examples for org.quartz.utils.Key

The following examples show how to use org.quartz.utils.Key. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: lams   Source File: TriggerBuilder.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Produce the <code>Trigger</code>.
 * 
 * @return a Trigger that meets the specifications of the builder.
 */
@SuppressWarnings("unchecked")
public T build() {

    if(scheduleBuilder == null)
        scheduleBuilder = SimpleScheduleBuilder.simpleSchedule();
    MutableTrigger trig = scheduleBuilder.build();
    
    trig.setCalendarName(calendarName);
    trig.setDescription(description);
    trig.setStartTime(startTime);
    trig.setEndTime(endTime);
    if(key == null)
        key = new TriggerKey(Key.createUniqueName(null), null);
    trig.setKey(key); 
    if(jobKey != null)
        trig.setJobKey(jobKey);
    trig.setPriority(priority);
    
    if(!jobDataMap.isEmpty())
        trig.setJobDataMap(jobDataMap);
    
    return (T) trig;
}
 
Example 2
Source Project: lams   Source File: JobBuilder.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 3
Source Project: AsuraFramework   Source File: JobStoreSupport.java    License: Apache License 2.0 6 votes vote down vote up
protected boolean removeJob(Connection conn, SchedulingContext ctxt,
        String jobName, String groupName, boolean activeDeleteSafe)
    throws JobPersistenceException {

    try {
        Key[] jobTriggers = getDelegate().selectTriggerNamesForJob(conn,
                jobName, groupName);
        for (int i = 0; i < jobTriggers.length; ++i) {
            deleteTriggerAndChildren(
                conn, jobTriggers[i].getName(), jobTriggers[i].getGroup());
        }

        return deleteJobAndChildren(conn, ctxt, jobName, groupName);
    } catch (SQLException e) {
        throw new JobPersistenceException("Couldn't remove job: "
                + e.getMessage(), e);
    }
}
 
Example 4
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * <p>
 * Get the names of all of the triggers that have misfired.
 * </p>
 * 
 * @param conn
 *          the DB Connection
 * @return an array of <code>{@link
 * org.quartz.utils.Key}</code> objects
 */
public Key[] selectMisfiredTriggers(Connection conn, long ts)
    throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn.prepareStatement(rtp(SELECT_MISFIRED_TRIGGERS));
        ps.setBigDecimal(1, new BigDecimal(String.valueOf(ts)));
        rs = ps.executeQuery();

        ArrayList list = new ArrayList();
        while (rs.next()) {
            String triggerName = rs.getString(COL_TRIGGER_NAME);
            String groupName = rs.getString(COL_TRIGGER_GROUP);
            list.add(new Key(triggerName, groupName));
        }
        Object[] oArr = list.toArray();
        Key[] kArr = new Key[oArr.length];
        System.arraycopy(oArr, 0, kArr, 0, oArr.length);
        return kArr;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 5
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * <p>
 * Select all of the triggers in a given state.
 * </p>
 * 
 * @param conn
 *          the DB Connection
 * @param state
 *          the state the triggers must be in
 * @return an array of trigger <code>Key</code> s
 */
public Key[] selectTriggersInState(Connection conn, String state)
    throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn.prepareStatement(rtp(SELECT_TRIGGERS_IN_STATE));
        ps.setString(1, state);
        rs = ps.executeQuery();

        ArrayList list = new ArrayList();
        while (rs.next()) {
            list.add(new Key(rs.getString(1), rs.getString(2)));
        }

        Key[] sArr = (Key[]) list.toArray(new Key[list.size()]);
        return sArr;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 6
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 6 votes vote down vote up
public Key[] selectMisfiredTriggersInState(Connection conn, String state,
        long ts) throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn.prepareStatement(rtp(SELECT_MISFIRED_TRIGGERS_IN_STATE));
        ps.setBigDecimal(1, new BigDecimal(String.valueOf(ts)));
        ps.setString(2, state);
        rs = ps.executeQuery();

        ArrayList list = new ArrayList();
        while (rs.next()) {
            String triggerName = rs.getString(COL_TRIGGER_NAME);
            String groupName = rs.getString(COL_TRIGGER_GROUP);
            list.add(new Key(triggerName, groupName));
        }
        Object[] oArr = list.toArray();
        Key[] kArr = new Key[oArr.length];
        System.arraycopy(oArr, 0, kArr, 0, oArr.length);
        return kArr;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 7
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 6 votes vote down vote up
public List selectStatefulJobsOfTriggerGroup(Connection conn,
        String groupName) throws SQLException {
    ArrayList jobList = new ArrayList();
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn
                .prepareStatement(rtp(SELECT_STATEFUL_JOBS_OF_TRIGGER_GROUP));
        ps.setString(1, groupName);
        setBoolean(ps, 2, true);
        rs = ps.executeQuery();

        while (rs.next()) {
            jobList.add(new Key(rs.getString(COL_JOB_NAME), rs
                    .getString(COL_JOB_GROUP)));
        }
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }

    return jobList;
}
 
Example 8
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * <p>
 * Select the trigger that will be fired at the given fire time.
 * </p>
 * 
 * @param conn
 *          the DB Connection
 * @param fireTime
 *          the time that the trigger will be fired
 * @return a <code>{@link org.quartz.utils.Key}</code> representing the
 *         trigger that will be fired at the given fire time, or null if no
 *         trigger will be fired at that time
 */
public Key selectTriggerForFireTime(Connection conn, long fireTime)
    throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;
    try {
        ps = conn.prepareStatement(rtp(SELECT_TRIGGER_FOR_FIRE_TIME));
        ps.setString(1, STATE_WAITING);
        ps.setBigDecimal(2, new BigDecimal(String.valueOf(fireTime)));
        rs = ps.executeQuery();

        if (rs.next()) {
            return new Key(rs.getString(COL_TRIGGER_NAME), rs
                    .getString(COL_TRIGGER_GROUP));
        } else {
            return null;
        }
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 9
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 6 votes vote down vote up
public Key[] selectVolatileTriggers(Connection conn) throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn.prepareStatement(rtp(SELECT_VOLATILE_TRIGGERS));
        setBoolean(ps, 1, true);
        rs = ps.executeQuery();

        ArrayList list = new ArrayList();
        while (rs.next()) {
            String triggerName = rs.getString(COL_TRIGGER_NAME);
            String groupName = rs.getString(COL_TRIGGER_GROUP);
            list.add(new Key(triggerName, groupName));
        }
        Object[] oArr = list.toArray();
        Key[] kArr = new Key[oArr.length];
        System.arraycopy(oArr, 0, kArr, 0, oArr.length);
        return kArr;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 10
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 6 votes vote down vote up
public Key[] selectVolatileJobs(Connection conn) throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn.prepareStatement(rtp(SELECT_VOLATILE_JOBS));
        setBoolean(ps, 1, true);
        rs = ps.executeQuery();

        ArrayList list = new ArrayList();
        while (rs.next()) {
            String triggerName = rs.getString(COL_JOB_NAME);
            String groupName = rs.getString(COL_JOB_GROUP);
            list.add(new Key(triggerName, groupName));
        }
        Object[] oArr = list.toArray();
        Key[] kArr = new Key[oArr.length];
        System.arraycopy(oArr, 0, kArr, 0, oArr.length);
        return kArr;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 11
Source Project: AsuraFramework   Source File: JobChainingJobListener.java    License: Apache License 2.0 6 votes vote down vote up
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) {

        Key sj = (Key) chainLinks.get(context.getJobDetail().getKey());

        if(sj == null) {
            return;
        }

        getLog().info("Job '" + context.getJobDetail().getFullName() + "' will now chain to Job '" + sj + "'");

        try {
            if(context.getJobDetail().isVolatile() || context.getTrigger().isVolatile()) {
                context.getScheduler().triggerJobWithVolatileTrigger(sj.getName(), sj.getGroup());
            } else {
                context.getScheduler().triggerJob(sj.getName(), sj.getGroup());
            }
        } catch(SchedulerException se) {
            getLog().error("Error encountered during chaining to Job '" + sj + "'", se);
        }
    }
 
Example 12
Source Project: spring-batch-rest   Source File: JobParamsDetail.java    License: Apache License 2.0 5 votes vote down vote up
public JobParamsDetail(JobDetail jobDetail) {

		this.setJobClass(jobDetail.getJobClass());
		this.setDescription(jobDetail.getDescription());
		if (jobDetail.getKey() == null)
			this.setKey(new JobKey(Key.createUniqueName(null), null));
		this.setKey(jobDetail.getKey());
		this.setDurability(jobDetail.isDurable());
		this.setRequestsRecovery(jobDetail.requestsRecovery());

		if (!jobDetail.getJobDataMap().isEmpty())
			this.setJobDataMap(jobDetail.getJobDataMap());
	}
 
Example 13
Source Project: AsuraFramework   Source File: JobStoreSupport.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * Removes all volatile data.
 * </p>
 * 
 * @throws JobPersistenceException
 *           if jobs could not be recovered
 */
protected void cleanVolatileTriggerAndJobs(Connection conn)
    throws JobPersistenceException {
    try {
        // find volatile jobs & triggers...
        Key[] volatileTriggers = getDelegate().selectVolatileTriggers(conn);
        Key[] volatileJobs = getDelegate().selectVolatileJobs(conn);

        for (int i = 0; i < volatileTriggers.length; i++) {
            removeTrigger(conn, null, volatileTriggers[i].getName(),
                    volatileTriggers[i].getGroup());
        }
        getLog().info(
                "Removed " + volatileTriggers.length
                        + " Volatile Trigger(s).");

        for (int i = 0; i < volatileJobs.length; i++) {
            removeJob(conn, null, volatileJobs[i].getName(),
                    volatileJobs[i].getGroup(), true);
        }
        getLog().info(
                "Removed " + volatileJobs.length + " Volatile Job(s).");

        // clean up any fired trigger entries
        getDelegate().deleteVolatileFiredTriggers(conn);

    } catch (Exception e) {
        throw new JobPersistenceException("Couldn't clean volatile data: "
                + e.getMessage(), e);
    }
}
 
Example 14
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * Get the names of all of the triggers in the given states that have
 * misfired - according to the given timestamp.  No more than count will
 * be returned.
 * </p>
 * 
 * @param conn The DB Connection
 * @param count The most misfired triggers to return, negative for all
 * @param resultList Output parameter.  A List of 
 *      <code>{@link org.quartz.utils.Key}</code> objects.  Must not be null.
 *          
 * @return Whether there are more misfired triggers left to find beyond
 *         the given count.
 */
public boolean selectMisfiredTriggersInStates(Connection conn, String state1, String state2,
    long ts, int count, List resultList) throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn.prepareStatement(rtp(SELECT_MISFIRED_TRIGGERS_IN_STATES));
        ps.setBigDecimal(1, new BigDecimal(String.valueOf(ts)));
        ps.setString(2, state1);
        ps.setString(3, state2);
        rs = ps.executeQuery();

        boolean hasReachedLimit = false;
        while (rs.next() && (hasReachedLimit == false)) {
            if (resultList.size() == count) {
                hasReachedLimit = true;
            } else {
                String triggerName = rs.getString(COL_TRIGGER_NAME);
                String groupName = rs.getString(COL_TRIGGER_GROUP);
                resultList.add(new Key(triggerName, groupName));
            }
        }
        
        return hasReachedLimit;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 15
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * Get the names of all of the triggers in the given group and state that
 * have misfired.
 * </p>
 * 
 * @param conn
 *          the DB Connection
 * @return an array of <code>{@link
 * org.quartz.utils.Key}</code> objects
 */
public Key[] selectMisfiredTriggersInGroupInState(Connection conn,
        String groupName, String state, long ts) throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn
                .prepareStatement(rtp(SELECT_MISFIRED_TRIGGERS_IN_GROUP_IN_STATE));
        ps.setBigDecimal(1, new BigDecimal(String.valueOf(ts)));
        ps.setString(2, groupName);
        ps.setString(3, state);
        rs = ps.executeQuery();

        ArrayList list = new ArrayList();
        while (rs.next()) {
            String triggerName = rs.getString(COL_TRIGGER_NAME);
            list.add(new Key(triggerName, groupName));
        }
        Object[] oArr = list.toArray();
        Key[] kArr = new Key[oArr.length];
        System.arraycopy(oArr, 0, kArr, 0, oArr.length);
        return kArr;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 16
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * Get the names of all of the triggers associated with the given job.
 * </p>
 * 
 * @param conn
 *          the DB Connection
 * @param jobName
 *          the name of the job
 * @param groupName
 *          the group containing the job
 * @return an array of <code>{@link
 * org.quartz.utils.Key}</code> objects
 */
public Key[] selectTriggerNamesForJob(Connection conn, String jobName,
        String groupName) throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn.prepareStatement(rtp(SELECT_TRIGGERS_FOR_JOB));
        ps.setString(1, jobName);
        ps.setString(2, groupName);
        rs = ps.executeQuery();

        ArrayList list = new ArrayList(10);
        while (rs.next()) {
            String trigName = rs.getString(COL_TRIGGER_NAME);
            String trigGroup = rs.getString(COL_TRIGGER_GROUP);
            list.add(new Key(trigName, trigGroup));
        }
        Object[] oArr = list.toArray();
        Key[] kArr = new Key[oArr.length];
        System.arraycopy(oArr, 0, kArr, 0, oArr.length);
        return kArr;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 17
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * Select the next trigger which will fire to fire between the two given timestamps 
 * in ascending order of fire time, and then descending by priority.
 * </p>
 * 
 * @param conn
 *          the DB Connection
 * @param noLaterThan
 *          highest value of <code>getNextFireTime()</code> of the triggers (exclusive)
 * @param noEarlierThan 
 *          highest value of <code>getNextFireTime()</code> of the triggers (inclusive)
 *          
 * @return A (never null, possibly empty) list of the identifiers (Key objects) of the next triggers to be fired.
 */
public List selectTriggerToAcquire(Connection conn, long noLaterThan, long noEarlierThan)
    throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;
    List nextTriggers = new LinkedList();
    try {
        ps = conn.prepareStatement(rtp(SELECT_NEXT_TRIGGER_TO_ACQUIRE));
        
        // Try to give jdbc driver a hint to hopefully not pull over 
        // more than the few rows we actually need.
        ps.setFetchSize(5);
        ps.setMaxRows(5);
        
        ps.setString(1, STATE_WAITING);
        ps.setBigDecimal(2, new BigDecimal(String.valueOf(noLaterThan)));
        ps.setBigDecimal(3, new BigDecimal(String.valueOf(noEarlierThan)));
        rs = ps.executeQuery();
        
        while (rs.next() && nextTriggers.size() < 5) {
            nextTriggers.add(new Key(
                    rs.getString(COL_TRIGGER_NAME),
                    rs.getString(COL_TRIGGER_GROUP)));
        }
        
        return nextTriggers;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }      
}
 
Example 18
Source Project: AsuraFramework   Source File: StdJDBCDelegate.java    License: Apache License 2.0 5 votes vote down vote up
public List selectInstancesFiredTriggerRecords(Connection conn,
        String instanceName) throws SQLException {
    PreparedStatement ps = null;
    ResultSet rs = null;
    try {
        List lst = new LinkedList();

        ps = conn.prepareStatement(rtp(SELECT_INSTANCES_FIRED_TRIGGERS));
        ps.setString(1, instanceName);
        rs = ps.executeQuery();

        while (rs.next()) {
            FiredTriggerRecord rec = new FiredTriggerRecord();

            rec.setFireInstanceId(rs.getString(COL_ENTRY_ID));
            rec.setFireInstanceState(rs.getString(COL_ENTRY_STATE));
            rec.setFireTimestamp(rs.getLong(COL_FIRED_TIME));
            rec.setSchedulerInstanceId(rs.getString(COL_INSTANCE_NAME));
            rec.setTriggerIsVolatile(getBoolean(rs, COL_IS_VOLATILE));
            rec.setTriggerKey(new Key(rs.getString(COL_TRIGGER_NAME), rs
                    .getString(COL_TRIGGER_GROUP)));
            if (!rec.getFireInstanceState().equals(STATE_ACQUIRED)) {
                rec.setJobIsStateful(getBoolean(rs, COL_IS_STATEFUL));
                rec.setJobRequestsRecovery(rs
                        .getBoolean(COL_REQUESTS_RECOVERY));
                rec.setJobKey(new Key(rs.getString(COL_JOB_NAME), rs
                        .getString(COL_JOB_GROUP)));
            }
            rec.setPriority(rs.getInt(COL_PRIORITY));
            lst.add(rec);
        }

        return lst;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
Example 19
Source Project: AsuraFramework   Source File: JobChainingJobListener.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 20
@Nullable
public EntityT execute(final ODatabaseDocumentTx db, final Key key) {
  checkNotNull(db);
  checkNotNull(key);

  List<ODocument> results = db.command(new OSQLSynchQuery<>(query))
      .execute(key.getName(), key.getGroup());

  if (results.isEmpty()) {
    return null;
  }
  return adapter.readEntity(results.get(0));
}
 
Example 21
public boolean execute(final ODatabaseDocumentTx db, final Key key) {
  checkNotNull(db);
  checkNotNull(key);

  int records = db.command(new OCommandSQL(query))
      .execute(key.getName(), key.getGroup());

  return records == 1;
}
 
Example 22
Source Project: nexus-public   Source File: ExistsByKeyAction.java    License: Eclipse Public License 1.0 5 votes vote down vote up
public boolean execute(final ODatabaseDocumentTx db, final Key key) {
  checkNotNull(db);
  checkNotNull(key);

  List<ODocument> results = db.command(new OSQLSynchQuery<>(query))
      .execute(key.getName(), key.getGroup());

  return results.get(0).<Long>field("count") == 1;
}
 
Example 23
Source Project: lams   Source File: AndMatcher.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create an AndMatcher that depends upon the result of both of the given matchers.
 */
public static <U extends Key<?>> AndMatcher<U> and(Matcher<U> leftOperand, Matcher<U> rightOperand) {
    return new AndMatcher<U>(leftOperand, rightOperand);
}
 
Example 24
Source Project: lams   Source File: NameMatcher.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a NameMatcher that matches names equaling the given string.
 */
public static <T extends Key<?>> NameMatcher<T> nameEquals(String compareTo) {
    return new NameMatcher<T>(compareTo, StringOperatorName.EQUALS);
}
 
Example 25
Source Project: lams   Source File: NameMatcher.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a NameMatcher that matches names starting with the given string.
 */
public static <U extends Key<?>> NameMatcher<U> nameStartsWith(String compareTo) {
    return new NameMatcher<U>(compareTo, StringOperatorName.STARTS_WITH);
}
 
Example 26
Source Project: lams   Source File: NameMatcher.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a NameMatcher that matches names ending with the given string.
 */
public static <U extends Key<?>> NameMatcher<U> nameEndsWith(String compareTo) {
    return new NameMatcher<U>(compareTo, StringOperatorName.ENDS_WITH);
}
 
Example 27
Source Project: lams   Source File: NameMatcher.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a NameMatcher that matches names containing the given string.
 */
public static <U extends Key<?>> NameMatcher<U> nameContains(String compareTo) {
    return new NameMatcher<U>(compareTo, StringOperatorName.CONTAINS);
}
 
Example 28
Source Project: lams   Source File: NotMatcher.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a NotMatcher that reverses the result of the given matcher.
 */
public static <U extends Key<?>> NotMatcher<U> not(Matcher<U> operand) {
    return new NotMatcher<U>(operand);
}
 
Example 29
Source Project: lams   Source File: KeyMatcher.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a KeyMatcher that matches Keys that equal the given key. 
 */
public static <U extends Key<?>> KeyMatcher<U> keyEquals(U compareTo) {
    return new KeyMatcher<U>(compareTo);
}
 
Example 30
Source Project: lams   Source File: GroupMatcher.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a GroupMatcher that matches groups equaling the given string.
 */
public static <T extends Key<T>> GroupMatcher<T> groupEquals(String compareTo) {
    return new GroupMatcher<T>(compareTo, StringOperatorName.EQUALS);
}