AnnotationAwareOrderComparator is an extension of
OrderComparator that supports Spring's
org.springframework.core.Ordered interface as well as the
@Order and @Priority
annotations, with an order value provided by an Ordered
instance overriding a statically defined annotation value (if any).
Consult the Javadoc for OrderComparator for details on the
sort semantics for non-ordered objects.
org.springframework.core.Ordered , org.springframework.core.annotation.Order , jakarta.annotation.Priority
| Modifier and Type | Field and Description |
|---|---|
| public static final AnnotationAwareOrderComparator | INSTANCE
Hides org. AnnotationAwareOrderComparator.
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Integer | findOrder(Object
the object to check obj)Overrides org. This implementation checks for |
| private Integer | |
| public Integer | getPriority(Object
the object to check obj)Overrides org. This implementation retrieves an @ |
| public static void | sort(List<?>
the List to sort list)Hides org. Sort the given list with a default |
| public static void | sort(Object[]
the array to sort array)Hides org. Sort the given array with a default AnnotationAwareOrderComparator. |
| public static void | sortIfNecessary(Object
the array or List to sort value)Hides org. Sort the given array or List with a default AnnotationAwareOrderComparator, if necessary. |
| INSTANCE | back to summary |
|---|---|
| public static final AnnotationAwareOrderComparator INSTANCE Hides org. Shared default instance of | |
| AnnotationAwareOrderComparator | back to summary |
|---|---|
| public AnnotationAwareOrderComparator() | |
| findOrder | back to summary |
|---|---|
| protected Integer findOrder(Object obj) Overrides org. This implementation checks for
| |
| findOrderFromAnnotation | back to summary |
|---|---|
private Integer findOrderFromAnnotation(Object obj)
| |
| getPriority | back to summary |
|---|---|
| public Integer getPriority(Object obj) Overrides org. This implementation retrieves an @
| |
| sort | back to summary |
|---|---|
| public static void sort(List<?> list) Hides org. Sort the given list with a default Optimized to skip sorting for lists with size 0 or 1, in order to avoid unnecessary array extraction.
| |
| sort | back to summary |
|---|---|
| public static void sort(Object[] array) Hides org. Sort the given array with a default AnnotationAwareOrderComparator. Optimized to skip sorting for lists with size 0 or 1, in order to avoid unnecessary array extraction.
| |
| sortIfNecessary | back to summary |
|---|---|
| public static void sortIfNecessary(Object value) Hides org. Sort the given array or List with a default AnnotationAwareOrderComparator, if necessary. Simply skips sorting when given any other value. Optimized to skip sorting for lists with size 0 or 1, in order to avoid unnecessary array extraction.
| |