Class SortingImpl
- java.lang.Object
-
- de.digitalcollections.model.impl.paging.SortingImpl
-
- All Implemented Interfaces:
Sorting,Serializable,Iterable<Order>
public class SortingImpl extends 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 toSorting.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, String... properties)Creates a newSortinginstance.SortingImpl(Direction direction, List<String> properties)Creates a newSortinginstance.SortingImpl(Order... orders)SortingImpl(String... properties)Creates a newSortinginstance.SortingImpl(List<Order> orders)Creates a newSortinginstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sortingand(Sorting sort)Returns a newSortingImplconsisting of theOrders of the currentSortingImplcombined with the given ones.booleanequals(Object obj)OrdergetOrderFor(String property)Returns the order registered for the given property.List<Order>getOrders()inthashCode()Iterator<Order>iterator()voidsetOrders(List<Order> orders)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
SortingImpl
public SortingImpl()
-
SortingImpl
public SortingImpl(Order... orders)
- Parameters:
orders- must not be null.
-
SortingImpl
public SortingImpl(List<Order> orders)
Creates a newSortinginstance.- Parameters:
orders- must not be null or contain null.
-
SortingImpl
public SortingImpl(String... properties)
Creates a newSortinginstance. Order defaults to Direction#ASC.- Parameters:
properties- must not be null or contain null or empty strings
-
SortingImpl
public SortingImpl(Direction direction, String... properties)
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
public SortingImpl(Direction direction, List<String> properties)
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 Detail
-
and
public Sorting and(Sorting sort)
Returns a newSortingImplconsisting of theOrders of the currentSortingImplcombined with the given ones.
-
getOrderFor
public Order getOrderFor(String property)
Returns the order registered for the given property.- Specified by:
getOrderForin interfaceSorting- Parameters:
property- given property- Returns:
- the order registered for the given property
-
-