org.test4j.hamcrest.matcher.property.comparator
类 MapComparator
java.lang.Object
org.test4j.hamcrest.matcher.property.comparator.MapComparator
- 所有已实现的接口:
- Comparator
public class MapComparator
- extends Object
- implements Comparator
Comparator for maps. This will compare all values with corresponding keys.
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MapComparator
public MapComparator()
canCompare
public boolean canCompare(Object left,
Object right)
- Returns true when both values are not null and instance of Map
- 指定者:
- 接口
Comparator 中的 canCompare
- 参数:
left - The left objectright - The right object
- 返回:
- True for maps
compare
public Difference compare(Object left,
Object right,
boolean onlyFirstDifference,
ReflectionComparator reflectionComparator)
- Compares the given maps by looping over the keys and comparing their values.
The key values are compared using a strict reflection comparison.
- 指定者:
- 接口
Comparator 中的 compare
- 参数:
left - 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 null
- 返回:
- A MapDifference or null if both maps are equal
Copyright © 2013. All rights reserved.