org.test4j.hamcrest.matcher.property.comparator
类 ListComparator

java.lang.Object
  继承者 org.test4j.hamcrest.matcher.property.comparator.ListComparator
所有已实现的接口:
Comparator

public class ListComparator
extends Object
implements Comparator

Comparator for collections and arrays. All elements are compared in the same order, i.e. element 1 of the left collection with element 1 of the right collection and so on.


构造方法摘要
ListComparator()
           
 
方法摘要
 boolean canCompare(Object left, Object right)
          Returns true when both objects are arrays or collections.
 Difference compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator)
          Compared the given collections/arrays.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ListComparator

public ListComparator()
方法详细信息

canCompare

public boolean canCompare(Object left,
                          Object right)
Returns true when both objects are arrays or collections.

指定者:
接口 Comparator 中的 canCompare
参数:
left - The left object
right - The right object
返回:
True in case of arrays/collections

compare

public Difference compare(Object left,
                          Object right,
                          boolean onlyFirstDifference,
                          ReflectionComparator reflectionComparator)
Compared the given collections/arrays.

指定者:
接口 Comparator 中的 compare
参数:
left - The left collection/array, not null
right - The right collection/array, not null
onlyFirstDifference - True if only the first difference should be returned
reflectionComparator - The root comparator for inner comparisons, not null
返回:
A CollectionDifference or null if both collections are equal


Copyright © 2013. All rights reserved.