Package org.xmlunit.diff
Class Difference
- java.lang.Object
-
- org.xmlunit.diff.Difference
-
public class Difference extends java.lang.ObjectCombines aComparisonand itsresult.As the name implies, the implicit assumption is that the result is not
ComparisonResult.EQUAL
-
-
Field Summary
Fields Modifier and Type Field Description private Comparisoncomparisonprivate ComparisonFormatterformatterprivate ComparisonResultresult
-
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).java.lang.StringtoString()Returns a string representation of this difference usingDefaultComparisonFormatterjava.lang.StringtoString(ComparisonFormatter formatter)Returns a string representation of this difference using the givenComparisonFormatter
-
-
-
Field Detail
-
result
private final ComparisonResult result
-
comparison
private final Comparison comparison
-
formatter
private ComparisonFormatter formatter
-
-
Constructor Detail
-
Difference
public Difference(Comparison comparison, ComparisonResult result)
Combines comparison and result.
-
-
Method Detail
-
getResult
public ComparisonResult getResult()
The result of the difference.
-
getComparison
public Comparison getComparison()
The details of the comparison.
-
setComparisonFormatter
public void setComparisonFormatter(ComparisonFormatter formatter)
Sets the default formatter to use withtoString(org.xmlunit.diff.ComparisonFormatter).- Since:
- XMLUnit 2.1.0
-
toString
public java.lang.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 java.lang.String toString()
Returns a string representation of this difference usingDefaultComparisonFormatter- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this difference
-
-