public class ClassComparator extends Object implements Comparator<Class<?>>
Constructor and Description |
---|
ClassComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(Class<?> firstClass,
Class<?> secondClass)
Compares the two given classes, returning a negative integer, zero or a
positive integer if the first class object is "less than", equal to, or
"greater than" the second class object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public int compare(Class<?> firstClass, Class<?> secondClass)
Class.toString()
is used to retrieve the string representation of
each class object which are then compared with
String.compareTo(String)
.compare
in interface Comparator<Class<?>>
firstClass
- The first class to compare.secondClass
- The second class to compare.firtClass
is "less than", equal to, or "greater than"
secondClass
.