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

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

Introduction

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

Prototype

public static Predicate nonePredicate(Collection predicates) 

Source Link

Document

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

Usage

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

public static <T> Collection<T> noneFilter(Collection<T> collection, Predicate... predicates) {
    if (collection == null || collection.isEmpty() || predicates == null) {
        return collection;
    } else {//  w w w  . j  a  v a2  s.co m
        //          Collection<T> list = new ArrayList<T>();
        //          list.addAll(collection);
        Collection<T> list = new ArrayList<>(collection);
        Predicate predicate = PredicateUtils.nonePredicate(predicates);
        CollectionUtils.filter(list, predicate);
        return list;
    }
}