Example usage for org.apache.commons.collections PredicateUtils anyPredicate

List of usage examples for org.apache.commons.collections PredicateUtils anyPredicate

Introduction

In this page you can find the example usage for org.apache.commons.collections PredicateUtils anyPredicate.

Prototype

public static Predicate anyPredicate(Collection predicates) 

Source Link

Document

Create a new Predicate that returns true if any of the specified predicates are true.

Usage

From source file:adalid.commons.util.ColUtils.java

public static <T> Collection<T> anyFilter(Collection<T> collection, Predicate... predicates) {
    if (collection == null || collection.isEmpty() || predicates == null) {
        return collection;
    } else {//w  w w .  j a  va 2  s.  c  o  m
        //          Collection<T> list = new ArrayList<T>();
        //          list.addAll(collection);
        Collection<T> list = new ArrayList<>(collection);
        Predicate predicate = PredicateUtils.anyPredicate(predicates);
        CollectionUtils.filter(list, predicate);
        return list;
    }
}

From source file:com.dtolabs.rundeck.core.utils.ScriptExecUtil.java

static Predicate any(Predicate... preds) {
    return PredicateUtils.anyPredicate(preds);
}

From source file:gov.nih.nci.ncicb.tcga.dcc.datareports.service.DatareportsServiceImpl.java

public void genORPredicateList(final Class clazz, final List<Predicate> pList, final List<String> valueList,
        final String getter) {
    final List l1 = genListPredicates(clazz, valueList, getter);
    if (l1 != null) {
        pList.add(PredicateUtils.anyPredicate(l1));
    }//from ww  w .  j  a va  2 s. c  o  m
}

From source file:org.sakaiproject.conditions.impl.BaseRule.java

public boolean evaluate(Object arg0) {
    Predicate judgement = new NullPredicate();
    if (predicates.size() == 1) {
        judgement = predicates.get(0);/*from   w ww . ja v  a2 s . c  om*/
    } else {
        if (conj == Conjunction.AND) {
            judgement = PredicateUtils.allPredicate(predicates);
        } else if (conj == Conjunction.OR) {
            judgement = PredicateUtils.anyPredicate(predicates);
        }
    }

    return judgement.evaluate(arg0);
}