Class RecursiveComparator
java.lang.Object
org.assertj.core.api.recursive.comparison.RecursiveComparator
- All Implemented Interfaces:
Comparator<Object>
Comparator
comparing objects recursively as in RecursiveComparisonAssert
.
This comparator does not enforce any ordering, it just returns 0 if compared objects are equals according the recursive comparison and a non 0 value otherwise.
This comparator honors the RecursiveComparisonConfiguration
passed at construction time.
-
Constructor Summary
ConstructorDescriptionRecursiveComparator
(RecursiveComparisonConfiguration recursiveComparisonConfiguration) Returns a newRecursiveComparator
that uses the givenRecursiveComparisonConfiguration
when comparing objects with the recursive comparison. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns 0 if the arguments are recursively equal to each other, a non-zero otherwise (no ordering enforced).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
RecursiveComparator
Returns a newRecursiveComparator
that uses the givenRecursiveComparisonConfiguration
when comparing objects with the recursive comparison.- Parameters:
recursiveComparisonConfiguration
- the usedRecursiveComparisonConfiguration
-
-
Method Details
-
compare
Returns 0 if the arguments are recursively equal to each other, a non-zero otherwise (no ordering enforced).- Specified by:
compare
in interfaceComparator<Object>
- Parameters:
actual
- the object to compare toother
other
- the object to compare toactual
- Returns:
- 0 if the arguments are recursively equal to each other, a non-zero otherwise.
-
getDescription
-