public class DefaultOrderProviderComparator extends java.lang.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 | Class and Description |
---|---|
private static class |
DefaultOrderProviderComparator.OrderProviderAwareComparator |
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(java.lang.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(java.util.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(java.util.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(java.lang.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)