Package org.custommonkey.xmlunit
Class Difference
java.lang.Object
org.custommonkey.xmlunit.Difference
Value object that describes a difference between DOM Nodes using one of
the DifferenceConstants ID values and a NodeDetail instance.
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Difference
(int id, String description) Constructor for non-similar Difference instancesprotected
Difference
(int id, String description, boolean recoverable) Constructor for similar or non-similar Difference instancesprotected
Difference
(Difference prototype, NodeDetail controlNodeDetail, NodeDetail testNodeDetail) Copy constructor using prototype Difference and encountered NodeDetails -
Method Summary
Modifier and TypeMethodDescriptionboolean
Now that Differences can be constructed from prototypes we need to be able to compare them to those in DifferenceConstantsint
getId()
int
hashCode()
hashcode implementation to go with equals.boolean
protected void
setRecoverable
(boolean overrideValue) Allow the recoverable field value to be overridden.toString()
-
Constructor Details
-
Difference
Constructor for non-similar Difference instances- Parameters:
id
- type of differencedescription
- description of the difference
-
Difference
Constructor for similar or non-similar Difference instances- Parameters:
id
- type of differencedescription
- description of the differencerecoverable
- whether the difference represents a similarity
-
Difference
Copy constructor using prototype Difference and encountered NodeDetails- Parameters:
prototype
- the difference to copy fromcontrolNodeDetail
- details of the control nodetestNodeDetail
- details of the test node
-
-
Method Details
-
getId
public int getId()- Returns:
- the id
-
getDescription
- Returns:
- the description
-
isRecoverable
public boolean isRecoverable()- Returns:
- TRUE if the difference represents a similarity, FALSE otherwise
-
setRecoverable
protected void setRecoverable(boolean overrideValue) Allow the recoverable field value to be overridden. Used when an override DifferenceListener is used in conjunction with a DetailedDiff.- Parameters:
overrideValue
- whether the difference represents a similarity
-
getControlNodeDetail
- Returns:
- the NodeDetail from the piece of XML used as the control at the Node where this difference was encountered
-
getTestNodeDetail
- Returns:
- the NodeDetail from the piece of XML used as the test at the Node where this difference was encountered
-
equals
Now that Differences can be constructed from prototypes we need to be able to compare them to those in DifferenceConstants -
hashCode
public int hashCode()hashcode implementation to go with equals. -
toString
-