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 and returns zero if the compared objects are equals, according to the recursive comparison, or a non-zero value otherwise.
- Since:
- 3.24.0
-
Constructor Summary
ConstructorDescriptionReturns a newRecursiveComparator
that uses the defaultRecursiveComparisonConfiguration
when comparing objects with the recursive comparison.RecursiveComparator
(RecursiveComparisonConfiguration recursiveComparisonConfiguration) Returns a newRecursiveComparator
that uses the givenRecursiveComparisonConfiguration
when comparing objects with the recursive comparison. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns zero if the arguments are recursively equal to each other, or 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
public RecursiveComparator()Returns a newRecursiveComparator
that uses the defaultRecursiveComparisonConfiguration
when comparing objects with the recursive comparison.- Since:
- 3.25.0
-
RecursiveComparator
Returns a newRecursiveComparator
that uses the givenRecursiveComparisonConfiguration
when comparing objects with the recursive comparison.- Parameters:
recursiveComparisonConfiguration
- theRecursiveComparisonConfiguration
instance to be used
-
-
Method Details
-
getDescription
-
compare
Returns zero if the arguments are recursively equal to each other, or 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:
- zero if the arguments are recursively equal to each other, or non-zero otherwise.
-