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 java.lang.Object
Encapsulates the current result and a flag that indicates whether comparison should be stopped.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
finished
private ComparisonResult
result
-
Constructor Summary
Constructors Modifier Constructor Description protected
ComparisonState(boolean finished, ComparisonResult result)
Creates a new ComparisonState.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractDifferenceEngine.ComparisonState
andIfTrueThen(boolean predicate, AbstractDifferenceEngine.DeferredComparison newStateProducer)
Maybe combines the current state with a different comparison.protected AbstractDifferenceEngine.ComparisonState
andIfTrueThen(boolean predicate, Comparison comp)
Maybe combines the current state with a different comparison.protected AbstractDifferenceEngine.ComparisonState
andThen(AbstractDifferenceEngine.DeferredComparison newStateProducer)
Combines the current state with a different comparison.protected AbstractDifferenceEngine.ComparisonState
andThen(Comparison comp)
Combines the current state with a different comparison.boolean
equals(java.lang.Object other)
int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
finished
private final boolean finished
-
result
private final ComparisonResult result
-
-
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.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-