Class InstanceOfFilter<T>

  • All Implemented Interfaces:
    Filter<T>

    public class InstanceOfFilter<T>
    extends Object
    implements Filter<T>
    A filter implementation that accepts all objects that are (sub)classes of a specified class.
    Version:
    2.9
    Author:
    Nicklas
    Last modified
    $Date: 2008-10-21 09:20:40 +0200 (ti, 21 okt 2008) $
    • Field Detail

      • clazz

        private final Class<?> clazz
      • allowSubclass

        private final boolean allowSubclass
    • Constructor Detail

      • InstanceOfFilter

        public InstanceOfFilter​(Class<?> clazz,
                                boolean allowSubclass)
        Create a new filter.
        Parameters:
        clazz - The class to match against
        allowSubclass - If subclasses to the specified class should be accepted (TRUE) or denied (FALSE)
    • Method Detail

      • evaluate

        public boolean evaluate​(T object)
        Description copied from interface: Filter
        Evaluate if the given object should pass the filter or not.
        Specified by:
        evaluate in interface Filter<T>
        Parameters:
        object - The object to evaluate
        Returns:
        TRUE if the object is an instance of the given class, FALSE otherwise