List of usage examples for org.apache.commons.collections PredicateUtils onePredicate
public static Predicate onePredicate(Collection predicates)
From source file:adalid.commons.util.ColUtils.java
public static <T> Collection<T> oneFilter(Collection<T> collection, Predicate... predicates) { if (collection == null || collection.isEmpty() || predicates == null) { return collection; } else {/*from ww w.j a va2s.c o m*/ // Collection<T> list = new ArrayList<T>(); // list.addAll(collection); Collection<T> list = new ArrayList<>(collection); Predicate predicate = PredicateUtils.onePredicate(predicates); CollectionUtils.filter(list, predicate); return list; } }