Class Sorting
java.lang.Object
de.digitalcollections.model.list.sorting.Sorting
SortingImpl option for queries. You have to provide at least a list of properties to sort for
that must not include null or empty strings. The direction defaults to
DEFAULT_DIRECTION
. See Spring Data Commons, but more flat design and independent of
Spring libraries.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Sorting.Builder
builder()
boolean
getOrderFor
(String property) Returns the order registered for the given property.int
hashCode()
iterator()
void
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
DEFAULT_DIRECTION
-
-
Constructor Details
-
Sorting
public Sorting() -
Sorting
- Parameters:
orders
- must not be null.
-
Sorting
Creates a newSorting
instance.- Parameters:
orders
- must not be null or contain null.
-
Sorting
Creates a newSorting
instance. Order defaults to Direction#ASC.- Parameters:
properties
- must not be null or contain null or empty strings
-
Sorting
Creates a newSorting
instance.- Parameters:
direction
- defaults toDEFAULT_DIRECTION
(for null cases, too)properties
- must not be null, empty or contain null or empty strings.
-
Sorting
Creates a newSorting
instance.- Parameters:
direction
- defaults toDEFAULT_DIRECTION
(for null cases, too)properties
- must not be null or contain null or empty strings.
-
-
Method Details
-
builder
-
and
- Parameters:
sort
- can be null.- Returns:
- a new combined sort
-
equals
-
getOrderFor
Returns the order registered for the given property.- Parameters:
property
- given property- Returns:
- the order registered for the given property
-
getOrders
-
hashCode
public int hashCode() -
iterator
-
setOrders
-
toString
-