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.


构造方法摘要
MapComparator()
           
 
方法摘要
 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.
 
从类 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 object
right - 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 null
right - The right map, not null
onlyFirstDifference - True if only the first difference should be returned
reflectionComparator - The root comparator for inner comparisons, not null
返回:
A MapDifference or null if both maps are equal


Copyright © 2013. All rights reserved.