Package org.xmlunit.diff
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 Summary
Constructors Modifier Constructor Description protectedComparisonState(boolean finished, ComparisonResult result)Creates a new ComparisonState.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractDifferenceEngine.ComparisonStateandIfTrueThen(boolean predicate, AbstractDifferenceEngine.DeferredComparison newStateProducer)Maybe combines the current state with a different comparison.protected AbstractDifferenceEngine.ComparisonStateandIfTrueThen(boolean predicate, Comparison comp)Maybe combines the current state with a different comparison.protected AbstractDifferenceEngine.ComparisonStateandThen(AbstractDifferenceEngine.DeferredComparison newStateProducer)Combines the current state with a different comparison.protected AbstractDifferenceEngine.ComparisonStateandThen(Comparison comp)Combines the current state with a different comparison.booleanequals(Object other)inthashCode()StringtoString()
-
-
-
Constructor Detail
-
ComparisonState
protected ComparisonState(boolean finished, ComparisonResult result)Creates a new ComparisonState.- Parameters:
finished- whether comparison should be stoppedresult- the current result
-
-
Method Detail
-
andThen
protected AbstractDifferenceEngine.ComparisonState andThen(AbstractDifferenceEngine.DeferredComparison newStateProducer)
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 comparisonsnewStateProducer- 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
protected AbstractDifferenceEngine.ComparisonState andThen(Comparison comp)
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 comparisonscomp- 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.
-
-