public class TypeComparators extends Object
Constructor and Description |
---|
TypeComparators() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Comparator<?> |
get(Class<?> clazz)
This method returns the most relevant comparator for the given class.
|
int |
hashCode() |
boolean |
isEmpty() |
<T> void |
put(Class<T> clazz,
Comparator<T> comparator)
Puts the
comparator for the given clazz . |
String |
toString() |
public Comparator<?> get(Class<?> clazz)
clazz
.
The order of checks is the following:
1. If there is a registered comparator for clazz
then this one is used
2. We check if there is a registered comparator for all the superclasses of clazz
3. We check if there is a registered comparator for all the interfaces if clazz
clazz
- the class for which to find a comparatornull
if no comparator could be foundpublic <T> void put(Class<T> clazz, Comparator<T> comparator)
comparator
for the given clazz
.T
- the type of the objects for the comparatorclazz
- the class for the comparatorcomparator
- the comparator it selfpublic boolean isEmpty()
true
is there are registered comparators, false
otherwiseCopyright © 2014–2016 AssertJ. All rights reserved.