public class DeepDifference extends Object
|Modifier and Type||Class and Description|
|Constructor and Description|
|Modifier and Type||Method and Description|
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 compare
b- Object two to compare
comparatorByPropertyOrField- comparators to compare properties or fields with the given names
comparatorByType- comparators to compare properties or fields with the given types
Copyright © 2013–2018 AssertJ. All rights reserved.