Java Code Examples for org.apache.commons.collections.CollectionUtils.find()

The following are Jave code examples for showing how to use find() of the org.apache.commons.collections.CollectionUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: redirector   File: SelectServer.java   View Source Code Vote up 5 votes
public IfExpression getRule(final String ruleId) {
    if (CollectionUtils.isEmpty(items)) {
        return null;
    }
    return (IfExpression)CollectionUtils.find(items, new Predicate() {
        @Override
        public boolean evaluate(Object object) {
            return ((IfExpression)object).getId().equals(ruleId);
        }
    });
}
 
Example 2
Project: redirector   File: URLRules.java   View Source Code Vote up 5 votes
public IfExpression getUrlRule(final String ruleId) {
    if (CollectionUtils.isEmpty(items)) {
        return null;
    }
    return (IfExpression)CollectionUtils.find(items, new Predicate() {
        @Override
        public boolean evaluate(Object object) {
            return ((IfExpression)object).getId().equals(ruleId);
        }
    });
}