|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.test4j.hamcrest.matcher.property.comparator.ObjectComparator
public class ObjectComparator
Comparator for objects. This will compare all corresponding field values.
| 构造方法摘要 | |
|---|---|
ObjectComparator()
|
|
| 方法摘要 | |
|---|---|
boolean |
canCompare(Object left,
Object right)
Returns true if both objects are not null |
Difference |
compare(Object left,
Object right,
boolean onlyFirstDifference,
ReflectionComparator reflectionComparator)
Compares the given objects by iterating over the fields and comparing the corresponding values. |
protected void |
compareFields(Object left,
Object right,
Class clazz,
ObjectDifference difference,
boolean onlyFirstDifference,
ReflectionComparator reflectionComparator)
Compares the values of all fields in the given objects by use of reflection. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public ObjectComparator()
| 方法详细信息 |
|---|
public boolean canCompare(Object left,
Object right)
Comparator 中的 canCompareleft - The left objectright - The right object
public Difference compare(Object left,
Object right,
boolean onlyFirstDifference,
ReflectionComparator reflectionComparator)
Comparator 中的 compareleft - The left object, not nullright - The right object, not nullonlyFirstDifference - True if only the first difference should be returnedreflectionComparator - The root comparator for inner comparisons, not null
protected void compareFields(Object left,
Object right,
Class clazz,
ObjectDifference difference,
boolean onlyFirstDifference,
ReflectionComparator reflectionComparator)
left - the left object for the comparison, not nullright - the right object for the comparison, not nullclazz - the type of the left object, not nulldifference - root difference, not nullonlyFirstDifference - True if only the first difference should be returnedreflectionComparator - the reflection comparator, not null
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||