Package it.tidalwave.util.spi
Interface ExtendedFinderSupport<T,F extends Finder<T>>
-
- All Superinterfaces:
java.lang.Cloneable
,Finder<T>
,java.io.Serializable
- All Known Subinterfaces:
FinderWithId<T,F>
- All Known Implementing Classes:
FinderWithIdMapSupport
,FinderWithIdSupport
public interface ExtendedFinderSupport<T,F extends Finder<T>> extends Finder<T>
A utility interface for creating extendedFinder
s, it provides automatic covariant return types. Make your extendedFinder
interface to extend from this. For instance, a customDate
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description F
from(int firstResult)
Tells theFinder
that only a subset of found items will be returned, starting from the given position.F
max(int maxResults)
Tells theFinder
that only a maximum number of found items will be returned.F
sort(Finder.SortCriterion criterion)
Tells theFinder
that results will be sorted according to the given criterion, in ascending direction.F
sort(Finder.SortCriterion criterion, Finder.SortDirection direction)
Tells theFinder
that results will be sorted according to the given criterion and direction.F
withContext(java.lang.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 Detail
-
from
@Nonnull F from(@Nonnegative int firstResult)
Tells theFinder
that only a subset of found items will be returned, starting from the given position.
-
max
@Nonnull F max(@Nonnegative int maxResults)
Tells theFinder
that only a maximum number of found items will be returned.
-
sort
@Nonnull F sort(@Nonnull Finder.SortCriterion criterion)
Tells theFinder
that results will be sorted according to the given criterion, in ascending direction.
-
sort
@Nonnull F sort(@Nonnull Finder.SortCriterion criterion, @Nonnull Finder.SortDirection direction)
Tells theFinder
that results will be sorted according to the given criterion and direction.
-
withContext
@Nonnull F withContext(@Nonnull java.lang.Object context)
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
-
-