java.lang.Object | |
↳ | org.springframework.core.OrderComparator |
Known Direct Subclasses |
Comparator implementation for Ordered
objects,
sorting by order value ascending (resp. by priority descending).
Non-Ordered
objects are treated as greatest order
values, thus ending up at the end of the list, in arbitrary order
(just like same order values of Ordered
objects).
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
INSTANCE | Shared default instance of OrderComparator. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sort the given List with a default OrderComparator.
| |||||||||||
Sort the given array with a default OrderComparator.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Determine the order value for the given object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.util.Comparator
|
Sort the given List with a default OrderComparator.
Optimized to skip sorting for lists with size 0 or 1, in order to avoid unnecessary array extraction.
list | the List to sort |
---|
Sort the given array with a default OrderComparator.
Optimized to skip sorting for lists with size 0 or 1, in order to avoid unnecessary array extraction.
array | the array to sort |
---|
Determine the order value for the given object.
The default implementation checks against the Ordered
interface. Can be overridden in subclasses.
obj | the object to check |
---|
Ordered.LOWEST_PRECEDENCE
as fallback