Interface ExtendedFinderSupport<T,​F extends Finder<T>>

  • All Superinterfaces:
    java.lang.Cloneable, Finder<T>, java.io.Serializable
    All Known Subinterfaces:
    FinderWithId<T,​F>, PersonFinder
    All Known Implementing Classes:
    FinderWithIdMapSupport, FinderWithIdSupport, PersonFinderImpl2a, PersonFinderImpl2b

    public interface ExtendedFinderSupport<T,​F extends Finder<T>>
    extends Finder<T>
    A utility interface for creating extended Finders, it provides automatic covariant return types. Make your extended Finder interface to extend from this. For instance, a custom Date finder can be declared as:
     public interface DateFinder extends ExtendedFinderSupport<SomeClass, DateFinder>
       {
         public DateFinder before (Date date);
    
         public DateFinder after (Date date);
       }
     
    Author:
    Fabrizio Giudici
    Status: draft API
    • Method Detail

      • from

        @Nonnull
        F from​(@Nonnegative
               int firstResult)
        Tells the Finder that only a subset of found items will be returned, starting from the given position.
        Specified by:
        from in interface Finder<T>
        Parameters:
        firstResult - the index of the first result to return
        Returns:
        the Finder
      • max

        @Nonnull
        F max​(@Nonnegative
              int maxResults)
        Tells the Finder that only a maximum number of found items will be returned.
        Specified by:
        max in interface Finder<T>
        Parameters:
        maxResults - the max number of results to return
        Returns:
        the Finder
      • sort

        @Nonnull
        F sort​(@Nonnull
               Finder.SortCriterion criterion)
        Tells the Finder that results will be sorted according to the given criterion, in ascending direction.
        Specified by:
        sort in interface Finder<T>
        Parameters:
        criterion - the sort criterion
        Returns:
        the Finder
      • sort

        @Nonnull
        F sort​(@Nonnull
               Finder.SortCriterion criterion,
               @Nonnull
               Finder.SortDirection direction)
        Tells the Finder that results will be sorted according to the given criterion and direction.
        Specified by:
        sort in interface Finder<T>
        Parameters:
        criterion - the sort criterion
        direction - the sort direction
        Returns:
        the Finder
      • withContext

        @Nonnull
        F withContext​(@Nonnull
                      java.lang.Object context)
        Tells the Finder that results should be created with the given context. This method can be called multiple times; contexts are accumulated.
        Specified by:
        withContext in interface Finder<T>
        Parameters:
        context - the context
        Returns:
        the Finder