Class AbstractDifferenceEngine.ComparisonState

java.lang.Object
org.xmlunit.diff.AbstractDifferenceEngine.ComparisonState
Direct Known Subclasses:
AbstractDifferenceEngine.FinishedComparisonState, AbstractDifferenceEngine.OngoingComparisonState
Enclosing class:
AbstractDifferenceEngine

protected abstract class AbstractDifferenceEngine.ComparisonState extends Object
Encapsulates the current result and a flag that indicates whether comparison should be stopped.
  • Constructor Details

    • ComparisonState

      protected ComparisonState(boolean finished, ComparisonResult result)
      Creates a new ComparisonState.
      Parameters:
      finished - whether comparison should be stopped
      result - the current result
  • Method Details

    • andThen

      Combines the current state with a different comparison.
      Parameters:
      newStateProducer - may be invoked to produce the next ConditionState
      Returns:
      this if the comparison should be stopped and the result of invoking newStateProducer otherwise.
    • andIfTrueThen

      protected AbstractDifferenceEngine.ComparisonState andIfTrueThen(boolean predicate, AbstractDifferenceEngine.DeferredComparison newStateProducer)
      Maybe combines the current state with a different comparison.
      Parameters:
      predicate - whether to combine the comparisons
      newStateProducer - may be invoked to produce the next ConditionState
      Returns:
      this if the comparison should be stopped or predicate is false and the result of invoking newStateProducer otherwise.
    • andThen

      Combines the current state with a different comparison.
      Parameters:
      comp - may be evaluated to produce the next ConditionState
      Returns:
      this if the comparison should be stopped and the result of evaluating comp otherwise.
    • andIfTrueThen

      protected AbstractDifferenceEngine.ComparisonState andIfTrueThen(boolean predicate, Comparison comp)
      Maybe combines the current state with a different comparison.
      Parameters:
      predicate - whether to combine the comparisons
      comp - may be evaluated to produce the next ConditionState
      Returns:
      this if the comparison should be stopped or predicate is false and the result of evaluating comp otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object