Package it.tidalwave.role
Interface Sortable
-
public interface Sortable
The role of an object that has contents that can be sorted.- Author:
- Fabrizio Giudici
- Status: stable API
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Class<Sortable>
_Sortable_
static Sortable
DEFAULT
A defaultSortable
which does nothing (useful for implementing the NullObject pattern).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Finder.SortCriterion
getSortCriterion()
Returns the current sort criterion.Finder.SortDirection
getSortDirection()
Returns the current sort direction.void
setSortCriterion(Finder.SortCriterion sortCriterion)
Sets the sort criterion.void
setSortDirection(Finder.SortDirection sortDirection)
Sets the sort direction.
-
-
-
Field Detail
-
_Sortable_
static final java.lang.Class<Sortable> _Sortable_
-
DEFAULT
static final Sortable DEFAULT
A defaultSortable
which does nothing (useful for implementing the NullObject pattern). This object always returnsFinder.SortCriterion.UNSORTED
assortCriterion
andFinder.SortDirection.ASCENDING
assortDirection
.
-
-
Method Detail
-
setSortCriterion
void setSortCriterion(@Nonnull Finder.SortCriterion sortCriterion)
Sets the sort criterion.- Parameters:
sortCriterion
- the sort criterion
-
setSortDirection
void setSortDirection(@Nonnull Finder.SortDirection sortDirection)
Sets the sort direction.- Parameters:
sortDirection
- the sort direction
-
getSortCriterion
@Nonnull Finder.SortCriterion getSortCriterion()
Returns the current sort criterion.- Returns:
- the sort criterion
-
getSortDirection
@Nonnull Finder.SortDirection getSortDirection()
Returns the current sort direction.- Returns:
- the sort direction
-
-