Class FileFilterAdapter

  • All Implemented Interfaces:
    java.io.FileFilter, Filter<java.io.File>

    public class FileFilterAdapter
    extends AbstractFilter<java.io.File>
    implements Filter<java.io.File>, java.io.FileFilter
    Filter implementation adapting a FileFilter instance to the Filter interface. Delegates the onCandidate(File) call to the supplied FileFilter delegate.
    Since:
    2.3
    • Field Detail

      • delegate

        private java.io.FileFilter delegate
    • Constructor Detail

      • FileFilterAdapter

        public FileFilterAdapter​(java.io.FileFilter delegate)
        Compound constructor, creating a FileFilterAdapter using the supplied FileFilter to determine if candidate Files should be accepted.
        Parameters:
        delegate - The delegate FileFilter.
    • Method Detail

      • isInitialized

        public boolean isInitialized()
        Specified by:
        isInitialized in interface Filter<java.io.File>
        Overrides:
        isInitialized in class AbstractFilter<java.io.File>
        Returns:
        true if this Filter has been properly initialized (by a call to the initialize method).
      • setDelegate

        public void setDelegate​(java.io.FileFilter delegate)
        Assigns the supplied FileFilter delegate.
        Parameters:
        delegate - A non-null FileFilter instance.
      • onCandidate

        protected boolean onCandidate​(java.io.File nonNullCandidate)

        Method that is invoked to determine if a candidate instance should be accepted or not.

        Specified by:
        onCandidate in class AbstractFilter<java.io.File>
        Parameters:
        nonNullCandidate - The candidate that should be tested for acceptance by this Filter. Never null.
        Returns:
        true if the candidate is accepted by this Filter and false otherwise.