it.tidalwave.util.spi
Interface ExtendedFinderSupport<Type,ExtendedFinder extends Finder<Type>>

Package class diagram package ExtendedFinderSupport
All Superinterfaces:
java.lang.Cloneable, Finder<Type>, java.io.Serializable

public interface ExtendedFinderSupport<Type,ExtendedFinder extends Finder<Type>>
extends Finder<Type>

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 class DateFinder extends ExtendedFinderSupport
   {
     public DateFinder before (Date date);
 
     public DateFinder after (Date date);
   }
 

Version:
$Id$
Author:
Fabrizio Giudici
Status: draft API

Nested Class Summary
 
Nested classes/interfaces inherited from interface it.tidalwave.util.Finder
Finder.FilterSortCriterion<Type>, Finder.SortCriterion, Finder.SortDirection
 
Method Summary
 ExtendedFinder from(int firstResult)
          Tells the Finder that only a subset of found items will be returned, starting from the given position.
 ExtendedFinder max(int maxResults)
          Tells the Finder that only a maximum number of found items will be returned.
 ExtendedFinder sort(Finder.SortCriterion criterion)
          Tells the Finder that results will be sorted according to the given criterion, in ascending direction.
 ExtendedFinder sort(Finder.SortCriterion criterion, Finder.SortDirection direction)
          Tells the Finder that results will be sorted according to the given criterion and direction.
 
Methods inherited from interface it.tidalwave.util.Finder
count, firstResult, ofType, result, results
 

Method Detail

from

@Nonnull
ExtendedFinder 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<Type>
Returns:
the Finder

max

@Nonnull
ExtendedFinder max(@Nonnegative
                           int maxResults)
Tells the Finder that only a maximum number of found items will be returned.

Specified by:
max in interface Finder<Type>
Returns:
the Finder

sort

@Nonnull
ExtendedFinder 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<Type>
Parameters:
criterion - the sort criterion
Returns:
the Finder

sort

@Nonnull
ExtendedFinder 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<Type>
Parameters:
criterion - the sort criterion
direction - the sort direction
Returns:
the Finder


Copyright © 2009-2011 Tidalwave s.a.s.. All Rights Reserved.