001    package org.nakedobjects.applib;
002    
003    /**
004     * For use by repository implementations to allow a set of objects returned by a back-end objectstore to be
005     * filtered before being returned to the caller.
006     * 
007     * <p>
008     * Note that this is different from the pattern or criteria object accepted by some repositories'
009     * <tt>findXxx</tt> methods. Such criteria objects are implementation-specific to the configured objectstore
010     * and allow it to return an already-filtered set of rows. (For example, a Hibernate-based ObjectStore would
011     * accept a representation of a HQL query; an XML-based objectstore might accept an XPath query, etc.)
012     */
013    public interface Filter<T> {
014            
015        /**
016         * Whether or not the supplied pojo meets this criteria.
017         * 
018         * @param pojo
019         * @return <tt>true</tt> if this pojo is acceptable, <tt>false</tt> otherwise.
020         */
021        public boolean accept(T pojo);
022    }