public class CompositeComparisonPerformer<T> extends AbstractComparisonPerformer<T>
Composite performer allows you to register multiple comparison performers for different properties of the
compared object beforehand. Each performer is mapped by an instance of the ClassPropertyKey the same way
results are mapped in the ComplexComparisonResult.
When apply(Object, Object) is called - the same method with the same arguments is called
for each delegate performer. Returned result is stored with the same key performer was stored with. As a result
complex comparison result is created.
| Constructor and Description |
|---|
CompositeComparisonPerformer(java.lang.String name,
java.util.Map<ClassPropertyKey,ComparisonPerformer<T>> performers) |
| Modifier and Type | Method and Description |
|---|---|
ComparisonResult |
apply(T actual,
T expected) |
java.util.Map<ClassPropertyKey,ComparisonPerformer<T>> |
getPerformers()
The same fully mutable map is used thru all the time of the performer life.
|
getName, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittestpublic CompositeComparisonPerformer(java.lang.String name,
java.util.Map<ClassPropertyKey,ComparisonPerformer<T>> performers)
public java.util.Map<ClassPropertyKey,ComparisonPerformer<T>> getPerformers()
The same fully mutable map is used thru all the time of the performer life. You can manipulate it manually.
Note: adding null keys or values will cause exception to be thrown
on apply(Object, Object) call!
public ComparisonResult apply(T actual, T expected)