Class FilterUtil


  • public class FilterUtil
    extends Object
    Utility class for working with and using filters.
    Version:
    2.9
    Author:
    Nicklas
    Last modified
    $Date: 2008-10-21 09:20:40 +0200 (ti, 21 okt 2008) $
    • Constructor Detail

      • FilterUtil

        public FilterUtil()
    • Method Detail

      • filter

        public static <T> List<T> filter​(Collection<? extends T> objects,
                                         Filter<? super T> filter)
        Filter a collection and return a new collection with the objects that passes the Filter.evaluate(Object) method. If the original collection is null, null is returned. If the original collection is empty, or if no objects passes the filter an empty list is returned. If the filter is null a list with all objects of the original collection is returned. The original collection is never modifed.
        Parameters:
        objects - The collection of objects
        filter - The filter
        Returns:
        A new collection, or null if the original collection is null
        Since:
        2.9