public class MapComparator extends Object implements Comparator
| Constructor and Description |
|---|
MapComparator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCompare(Object left,
Object right)
Returns true when both values are not null and instance of Map
|
Difference |
compare(Object left,
Object right,
boolean onlyFirstDifference,
ReflectionComparator reflectionComparator)
Compares the given maps by looping over the keys and comparing their values.
|
public boolean canCompare(Object left, Object right)
canCompare in interface Comparatorleft - The left objectright - The right objectpublic Difference compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
compare in interface Comparatorleft - The left map, not nullright - The right map, not nullonlyFirstDifference - True if only the first difference should be returnedreflectionComparator - The root comparator for inner comparisons, not nullCopyright © 2016. All Rights Reserved.