public final class ESPriorityComparator extends Object implements Comparator<ESExtensionElement>
ESExtensionElement. This allows to sort the elements in the ESExtensionPoint in
order to represent priority of registered elements.
This comparator by default uses a field priority, which is expected to hold an priority number and then sort
by by this number.| Constructor and Description |
|---|
ESPriorityComparator()
Default constructor.
|
ESPriorityComparator(boolean descending)
Constructor which allows to config the ordering.
|
ESPriorityComparator(String fieldname,
boolean descending)
Constructor allows to config fieldname and ordering.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(ESExtensionElement element1,
ESExtensionElement element2) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic ESPriorityComparator()
public ESPriorityComparator(boolean descending)
descending - if true, priorities are sorted in descending order, ascending otherwisepublic ESPriorityComparator(String fieldname, boolean descending)
fieldname - the attribute id of the priority fielddescending - if true, priorities are sorted in descending order, ascending otherwisepublic int compare(ESExtensionElement element1, ESExtensionElement element2)
compare in interface Comparator<ESExtensionElement>Copyright © 2017. All rights reserved.