Package it.tidalwave.util.spi
Interface ExtendedFinderSupport<TYPE,EXTENDED_FINDER extends Finder<TYPE>>
-
- All Superinterfaces:
java.lang.Cloneable,Finder<TYPE>,java.io.Serializable
- All Known Subinterfaces:
PersonFinder
- All Known Implementing Classes:
PersonFinderImpl2a,PersonFinderImpl2b
public interface ExtendedFinderSupport<TYPE,EXTENDED_FINDER extends Finder<TYPE>> extends Finder<TYPE>
A utility interface for creating extendedFinders, it provides automatic covariant return types. Make your extendedFinderinterface to extend from this. For instance, a customDatefinder 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface it.tidalwave.util.Finder
Finder.InMemorySortCriterion<TYPE>, Finder.SortCriterion, Finder.SortDirection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EXTENDED_FINDERfrom(int firstResult)Tells theFinderthat only a subset of found items will be returned, starting from the given position.EXTENDED_FINDERmax(int maxResults)Tells theFinderthat only a maximum number of found items will be returned.EXTENDED_FINDERsort(Finder.SortCriterion criterion)Tells theFinderthat results will be sorted according to the given criterion, in ascending direction.EXTENDED_FINDERsort(Finder.SortCriterion criterion, Finder.SortDirection direction)Tells theFinderthat results will be sorted according to the given criterion and direction.EXTENDED_FINDERwithContext(java.lang.Object context)Tells theFinderthat results should be created with the given context.-
Methods inherited from interface it.tidalwave.util.Finder
count, firstResult, iterator, ofType, optionalFirstResult, optionalResult, result, results, stream
-
-
-
-
Method Detail
-
from
@Nonnull EXTENDED_FINDER from(@Nonnegative int firstResult)
Tells theFinderthat only a subset of found items will be returned, starting from the given position.
-
max
@Nonnull EXTENDED_FINDER max(@Nonnegative int maxResults)
Tells theFinderthat only a maximum number of found items will be returned.
-
sort
@Nonnull EXTENDED_FINDER sort(@Nonnull Finder.SortCriterion criterion)
Tells theFinderthat results will be sorted according to the given criterion, in ascending direction.
-
sort
@Nonnull EXTENDED_FINDER sort(@Nonnull Finder.SortCriterion criterion, @Nonnull Finder.SortDirection direction)
Tells theFinderthat results will be sorted according to the given criterion and direction.
-
withContext
@Nonnull EXTENDED_FINDER withContext(@Nonnull java.lang.Object context)
Tells theFinderthat results should be created with the given context. This method can be called multiple times; contexts are accumulated.- Specified by:
withContextin interfaceFinder<TYPE>- Parameters:
context- the context- Returns:
- the
Finder
-
-