Package org.xmlunit.diff
Class Difference
- java.lang.Object
-
- org.xmlunit.diff.Difference
-
public class Difference extends Object
Combines aComparisonand itsresult.As the name implies, the implicit assumption is that the result is not
ComparisonResult.EQUAL
-
-
Constructor Summary
Constructors Constructor Description Difference(Comparison comparison, ComparisonResult result)Combines comparison and result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ComparisongetComparison()The details of the comparison.ComparisonResultgetResult()The result of the difference.voidsetComparisonFormatter(ComparisonFormatter formatter)Sets the default formatter to use withtoString(org.xmlunit.diff.ComparisonFormatter).StringtoString()Returns a string representation of this difference usingDefaultComparisonFormatterStringtoString(ComparisonFormatter formatter)Returns a string representation of this difference using the givenComparisonFormatter
-
-
-
Constructor Detail
-
Difference
public Difference(Comparison comparison, ComparisonResult result)
Combines comparison and result.- Parameters:
comparison- the comparisonresult- the result of the comparison
-
-
Method Detail
-
getResult
public ComparisonResult getResult()
The result of the difference.- Returns:
- result of the difference
-
getComparison
public Comparison getComparison()
The details of the comparison.- Returns:
- details of the comparison
-
setComparisonFormatter
public void setComparisonFormatter(ComparisonFormatter formatter)
Sets the default formatter to use withtoString(org.xmlunit.diff.ComparisonFormatter).- Parameters:
formatter- the ComparisonFormatter to use- Since:
- XMLUnit 2.1.0
-
toString
public String toString(ComparisonFormatter formatter)
Returns a string representation of this difference using the givenComparisonFormatter- Parameters:
formatter- the ComparisonFormatter to use- Returns:
- a string representation of this difference
-
toString
public String toString()
Returns a string representation of this difference usingDefaultComparisonFormatter
-
-