public class DefaultOrderProviderComparator extends Object implements OrderProviderComparator
OrderProviderComparator
implementation that uses the
value provided by the OrderProvider
and fallbacks to
AnnotationAwareOrderComparator
if none is set.
This essentially means that the value of the OrderProvider
takes precedence over the behavior of AnnotationAwareOrderComparator
Modifier and Type | Field and Description |
---|---|
static DefaultOrderProviderComparator |
INSTANCE
Shared default instance of DefaultOrderProviderComparator.
|
Constructor and Description |
---|
DefaultOrderProviderComparator() |
Modifier and Type | Method and Description |
---|---|
void |
sortArray(Object[] items,
OrderProvider orderProvider)
Sort the specified array of items according to their order value,
using the specified
OrderProvider to retrieve an order
if necessary. |
void |
sortList(List<?> items,
OrderProvider orderProvider)
Sort the specified list of items according to their order value,
using the specified
OrderProvider to retrieve an order
if necessary. |
public static final DefaultOrderProviderComparator INSTANCE
public void sortList(List<?> items, OrderProvider orderProvider)
OrderProviderComparator
OrderProvider
to retrieve an order
if necessary.sortList
in interface OrderProviderComparator
items
- the items to sortorderProvider
- the order provider to useCollections.sort(java.util.List, java.util.Comparator)
public void sortArray(Object[] items, OrderProvider orderProvider)
OrderProviderComparator
OrderProvider
to retrieve an order
if necessary.sortArray
in interface OrderProviderComparator
items
- the items to sortorderProvider
- the order provider to useArrays.sort(Object[], java.util.Comparator)