Class Filter<T>


  • @Deprecated
    public class Filter<T>
    extends Object
    Deprecated.
    Most of the functionality of this class can now be achieved via lambda expressions.
    $Id$

    Created: Feb 1, 2006

    Performs collection filtering based on a set of rules. A filter may dictate whether at least one rule or all rules are matched.

    NOTE: Implementation of filter rules has changed in recent releases to fix behaviour. Please ensure you update your code to use explicit constructors.

    • Field Detail

      • MATCH_ANY

        public static final int MATCH_ANY
        Deprecated.
        Indicates that any rule may be matched to include an object in the filtered collection.
        See Also:
        Constant Field Values
      • MATCH_ALL

        public static final int MATCH_ALL
        Deprecated.
        Indicates that all rules must be matched to include an object in the filtered collection.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Filter

        @SafeVarargs
        public Filter​(Predicate<T>... rules)
        Deprecated.
        Parameters:
        rules - one or more rules that are applied by this filter
      • Filter

        public Filter​(Predicate<T>[] rules,
                      int type)
        Deprecated.
        Constructor.
        Parameters:
        rules - an array of rules that define this filter
        type - the type of matching to apply
        See Also:
        MATCH_ALL, MATCH_ANY
    • Method Detail

      • filter

        public final Collection<T> filter​(Collection<T> c)
        Deprecated.
        Filter the given collection into a new collection.
        Parameters:
        c - a collection to filter
        Returns:
        a filtered collection
      • filter

        public final T[] filter​(T[] objects)
        Deprecated.
        Returns a filtered subset of the specified array.
        Parameters:
        objects - an array to filter
        Returns:
        a filtered array
      • getRules

        public final Predicate<T>[] getRules()
        Deprecated.
        Returns:
        Returns the rules.
      • setRules

        public final void setRules​(Predicate<T>[] rules)
        Deprecated.
        Parameters:
        rules - The rules to set.