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:
PersonFinderImpl2
public interface ExtendedFinderSupport<TYPE,EXTENDED_FINDER extends Finder<TYPE>> extends Finder<TYPE>
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<TYPE>, Finder.SortCriterion, Finder.SortDirection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EXTENDED_FINDER
from(int firstResult)
Tells theFinder
that only a subset of found items will be returned, starting from the given position.EXTENDED_FINDER
max(int maxResults)
Tells theFinder
that only a maximum number of found items will be returned.EXTENDED_FINDER
sort(Finder.SortCriterion criterion)
Tells theFinder
that results will be sorted according to the given criterion, in ascending direction.EXTENDED_FINDER
sort(Finder.SortCriterion criterion, Finder.SortDirection direction)
Tells theFinder
that results will be sorted according to the given criterion and direction.EXTENDED_FINDER
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, iterator, ofType, optionalFirstResult, optionalResult, result, results, stream
-
-
-
-
Method Detail
-
from
@Nonnull EXTENDED_FINDER from(@Nonnegative int firstResult)
Tells theFinder
that only a subset of found items will be returned, starting from the given position.
-
max
@Nonnull EXTENDED_FINDER max(@Nonnegative int maxResults)
Tells theFinder
that only a maximum number of found items will be returned.
-
sort
@Nonnull EXTENDED_FINDER sort(@Nonnull Finder.SortCriterion criterion)
Tells theFinder
that 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 theFinder
that results will be sorted according to the given criterion and direction.
-
withContext
@Nonnull EXTENDED_FINDER 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<TYPE>
- Parameters:
context
- the context- Returns:
- the
Finder
-
-