Class SortingImpl
java.lang.Object
de.digitalcollections.model.impl.paging.SortingImpl
public class SortingImpl extends java.lang.Object implements 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
Sorting.DEFAULT_DIRECTION. See Spring Data Commons, but more flat design and independent of
Spring libraries.- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.digitalcollections.model.api.paging.Sorting
Sorting.Builder -
Field Summary
Fields inherited from interface de.digitalcollections.model.api.paging.Sorting
DEFAULT_DIRECTION -
Constructor Summary
Constructors Constructor Description SortingImpl()SortingImpl(Direction direction, java.lang.String... properties)Creates a newSortinginstance.SortingImpl(Direction direction, java.util.List<java.lang.String> properties)Creates a newSortinginstance.SortingImpl(Order... orders)SortingImpl(java.lang.String... properties)Creates a newSortinginstance.SortingImpl(java.util.List<Order> orders)Creates a newSortinginstance. -
Method Summary
Modifier and Type Method Description Sortingand(Sorting sort)Returns a newSortingImplconsisting of theOrders of the currentSortingImplcombined with the given ones.booleanequals(java.lang.Object obj)OrdergetOrderFor(java.lang.String property)Returns the order registered for the given property.java.util.List<Order>getOrders()inthashCode()java.util.Iterator<Order>iterator()voidsetOrders(java.util.List<Order> orders)java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SortingImpl
public SortingImpl() -
SortingImpl
- Parameters:
orders- must not be null.
-
SortingImpl
Creates a newSortinginstance.- Parameters:
orders- must not be null or contain null.
-
SortingImpl
public SortingImpl(java.lang.String... properties)Creates a newSortinginstance. Order defaults to Direction#ASC.- Parameters:
properties- must not be null or contain null or empty strings
-
SortingImpl
Creates a newSortinginstance.- Parameters:
direction- defaults toSorting.DEFAULT_DIRECTION(for null cases, too)properties- must not be null, empty or contain null or empty strings.
-
SortingImpl
Creates a newSortinginstance.- Parameters:
direction- defaults toSorting.DEFAULT_DIRECTION(for null cases, too)properties- must not be null or contain null or empty strings.
-
-
Method Details
-
getOrders
-
setOrders
-
and
Returns a newSortingImplconsisting of theOrders of the currentSortingImplcombined with the given ones. -
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
getOrderFor
Returns the order registered for the given property.- Specified by:
getOrderForin interfaceSorting- Parameters:
property- given property- Returns:
- the order registered for the given property
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
iterator
- Specified by:
iteratorin interfacejava.lang.Iterable<Order>
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-