public class Sorter extends Ordering implements Comparator<Description>
Sorter orders tests. In general you will not need
to use a Sorter directly. Instead, use
Request.sortWith(Comparator).Ordering.Context, Ordering.Factory| Modifier and Type | Field and Description |
|---|---|
static Sorter |
NULL
NULL is a
Sorter that leaves elements in an undefined order |
| Constructor and Description |
|---|
Sorter(Comparator<Description> comparator)
Creates a
Sorter that uses comparator
to sort tests |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(Object target)
Sorts the tests in
target using comparator. |
int |
compare(Description o1,
Description o2) |
protected List<Description> |
orderItems(Collection<Description> descriptions)
Implemented by sub-classes to order the descriptions.
|
definedBy, definedBy, shuffledByclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic Sorter(Comparator<Description> comparator)
Sorter that uses comparator
to sort testscomparator - the Comparator to use when sorting testspublic int compare(Description o1, Description o2)
compare in interface Comparator<Description>protected final List<Description> orderItems(Collection<Description> descriptions)
orderItems in class OrderingCopyright © 2002–2020 JUnit. All rights reserved.