001    package org.nakedobjects.applib.query;
002    
003    import java.io.Serializable;
004    
005    import org.nakedobjects.applib.DomainObjectContainer;
006    import org.nakedobjects.applib.Filter;
007    
008    /**
009     * For use by repository implementations, representing the values of a query.
010     * 
011     * <p>
012     * The implementations of these objects are be provided by the underlying
013     * persistor/object store; consult its documentation.
014     * 
015     * <p>
016     * <b>Note:</b> that not every object store will necessarily support this
017     * interface. In particular, the in-memory object store does not. For this, you
018     * can use the {@link Filter} interface to similar effect, for example in
019     * {@link DomainObjectContainer#allMatches(Class, Filter)}). Note that the
020     * filtering is done within the {@link DomainObjectContainer} rather than being
021     * pushed back to the object store.
022     */
023    public interface Query<T> extends Serializable {
024    
025            /**
026             * The {@link Class} of the objects returned by this query.
027             */
028            public Class<T> getResultType();
029    
030            /**
031             * A human-readable representation of this query and its values.
032             */
033            public String getDescription();
034    }