Class Difference

java.lang.Object
org.xmlunit.diff.Difference

public class Difference extends Object
Combines a Comparison and its result.

As the name implies, the implicit assumption is that the result is not ComparisonResult.EQUAL

  • Constructor Details

    • Difference

      public Difference(Comparison comparison, ComparisonResult result)
      Combines comparison and result.
      Parameters:
      comparison - the comparison
      result - the result of the comparison
  • Method Details

    • 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 with toString(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 given ComparisonFormatter
      Parameters:
      formatter - the ComparisonFormatter to use
      Returns:
      a string representation of this difference
    • toString

      public String toString()
      Returns a string representation of this difference using DefaultComparisonFormatter
      Overrides:
      toString in class Object
      Returns:
      a string representation of this difference