public class DeepDifference extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DeepDifference.Difference |
Constructor and Description |
---|
DeepDifference() |
Modifier and Type | Method and Description |
---|---|
static List<DeepDifference.Difference> |
determineDifferences(Object a,
Object b,
Map<String,Comparator<?>> comparatorByPropertyOrField,
TypeComparators comparatorByType)
Compare two objects for differences by doing a 'deep' comparison.
|
public static List<DeepDifference.Difference> determineDifferences(Object a, Object b, Map<String,Comparator<?>> comparatorByPropertyOrField, TypeComparators comparatorByType)
This method handles cycles correctly, for example A->B->C->A. Suppose a and a' are two separate instances of the A with the same values for all fields on A, B, and C. Then a.deepEquals(a') will return an empty list. It uses cycle detection storing visited objects in a Set to prevent endless loops.
a
- Object one to compareb
- Object two to comparecomparatorByPropertyOrField
- comparators to compare properties or fields with the given namescomparatorByType
- comparators to compare properties or fields with the given typesCopyright © 2014–2019 AssertJ. All rights reserved.