Module it.tidalwave.util
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
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
-
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 theFinderthat only a subset of found items will be returned, starting from the given position.max(int maxResults) Tells theFinderthat only a maximum number of found items will be returned.sort(Finder.SortCriterion criterion) Tells theFinderthat results will be sorted according to the given criterion, in ascending direction.sort(Finder.SortCriterion criterion, Finder.SortDirection direction) Tells theFinderthat results will be sorted according to the given criterion and direction.withContext(Object context) Tells theFinderthat 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 theFinderthat only a subset of found items will be returned, starting from the given position. -
max
Tells theFinderthat only a maximum number of found items will be returned. -
sort
Tells theFinderthat results will be sorted according to the given criterion, in ascending direction. -
sort
Tells theFinderthat results will be sorted according to the given criterion and direction. -
withContext
Tells theFinderthat results should be created with the given context. This method can be called multiple times; contexts are accumulated. Not all implementations ofFinderhave this working.- Specified by:
withContextin interfaceFinder<T>- Parameters:
context- the context- Returns:
- the
Finder
-