Package it.tidalwave.util.spi
Interface ExtendedFinderSupport<T,F extends Finder<T>>
- All Superinterfaces:
Cloneable
,Finder<T>
,Serializable
- All Known Subinterfaces:
FinderWithId<T,
F>
- All Known Implementing Classes:
FinderWithIdMapSupport
,FinderWithIdSupport
A utility interface for creating extended
Finder
s, 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
-
Nested Class Summary
Nested classes/interfaces inherited from interface it.tidalwave.util.Finder
Finder.InMemorySortCriterion<U>, Finder.SortCriterion, Finder.SortDirection
-
Method Summary
Modifier and TypeMethodDescriptionfrom
(int firstResult) Tells theFinder
that only a subset of found items will be returned, starting from the given position.max
(int maxResults) Tells theFinder
that only a maximum number of found items will be returned.sort
(Finder.SortCriterion criterion) Tells theFinder
that results will be sorted according to the given criterion, in ascending direction.sort
(Finder.SortCriterion criterion, Finder.SortDirection direction) Tells theFinder
that results will be sorted according to the given criterion and direction.withContext
(Object context) Tells theFinder
that results should be created with the given context.Methods inherited from interface it.tidalwave.util.Finder
count, firstResult, forEach, from, from, iterator, max, max, ofType, optionalFirstResult, optionalResult, result, results, stream
-
Method Details
-
from
Tells theFinder
that only a subset of found items will be returned, starting from the given position. -
max
Tells theFinder
that only a maximum number of found items will be returned. -
sort
Tells theFinder
that results will be sorted according to the given criterion, in ascending direction. -
sort
Tells theFinder
that results will be sorted according to the given criterion and direction. -
withContext
Tells theFinder
that results should be created with the given context. This method can be called multiple times; contexts are accumulated.- Specified by:
withContext
in interfaceFinder<T>
- Parameters:
context
- the context- Returns:
- the
Finder
-