org.test4j.hamcrest.matcher.property.difference
类 ObjectDifference

java.lang.Object
  继承者 org.test4j.hamcrest.matcher.property.difference.Difference
      继承者 org.test4j.hamcrest.matcher.property.difference.ObjectDifference

public class ObjectDifference
extends Difference

A class for holding the difference between two objects.


构造方法摘要
ObjectDifference(String message, Object leftValue, Object rightValue)
          Creates a difference.
 
方法摘要
<T,A> T
accept(DifferenceVisitor<T,A> visitor, A argument)
          Double dispatch method.
 void addFieldDifference(String fieldName, Difference difference)
          Adds a difference for the field with the given name.
 Map<String,Difference> getFieldDifferences()
          Gets all differences per field name.
 
从类 org.test4j.hamcrest.matcher.property.difference.Difference 继承的方法
getLeftValue, getMessage, getRightValue, toString
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

ObjectDifference

public ObjectDifference(String message,
                        Object leftValue,
                        Object rightValue)
Creates a difference.

参数:
message - a message describing the difference
leftValue - the left instance
rightValue - the right instance
方法详细信息

addFieldDifference

public void addFieldDifference(String fieldName,
                               Difference difference)
Adds a difference for the field with the given name.

参数:
fieldName - The field name, not null
difference - The difference, not null

getFieldDifferences

public Map<String,Difference> getFieldDifferences()
Gets all differences per field name.

返回:
The differences, not null

accept

public <T,A> T accept(DifferenceVisitor<T,A> visitor,
                      A argument)
Double dispatch method. Dispatches back to the given visitor.

All subclasses should copy this method in their own class body.

覆盖:
Difference 中的 accept
参数:
visitor - The visitor, not null
argument - An optional argument for the visitor, null if not applicable
返回:
The result


Copyright © 2013. All rights reserved.