Package com.blazebit.persistence.view
Class Sorters
java.lang.Object
com.blazebit.persistence.view.Sorters
public final class Sorters extends Object
A utility class that provides methods to create standard sorters.
- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and Type Method Description static Sorter
ascending()
Likeascending(boolean)
but withnullsFirst
set to false.static Sorter
ascending(boolean nullsFirst)
Likesorter(boolean, boolean)
but withascending
set to true.static Sorter
descending()
Likedescending(boolean)
but withnullsFirst
set to false.static Sorter
descending(boolean nullsFirst)
Likesorter(boolean, boolean)
but withascending
set to false.static Sorter
sorter(boolean ascending, boolean nullsFirst)
Creates and returns a newSorter
.
-
Method Details
-
sorter
Creates and returns a newSorter
. The sorter has the following properties- sorts ascending if the flag
ascending
is true, descending otherwise - sorts nulls first is the flag
nullsFirst
is ture, nulls last otherwise
- Parameters:
ascending
- If true sorts ascending, otherwise descendingnullsFirst
- If true sorts nulls first, otherwise nulls last- Returns:
- A new sorter
- sorts ascending if the flag
-
ascending
Likesorter(boolean, boolean)
but withascending
set to true.- Parameters:
nullsFirst
- If true sorts nulls first, otherwise nulls last- Returns:
- A new sorter
-
descending
Likesorter(boolean, boolean)
but withascending
set to false.- Parameters:
nullsFirst
- If true sorts nulls first, otherwise nulls last- Returns:
- A new sorter
-
ascending
Likeascending(boolean)
but withnullsFirst
set to false.- Returns:
- A new sorter
-
descending
Likedescending(boolean)
but withnullsFirst
set to false.- Returns:
- A new sorter
-