Top Description Fields Constructors Methods
org.assertj.core.api.recursive.comparison

public Class RecursiveComparator

extends Object
implements Comparator<Object>
Class Inheritance
All Implemented Interfaces
java.util.Comparator
Static Imports
java.lang.String.format

Comparator comparing objects recursively as in org.assertj.core.api.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

Field Summary

Modifier and TypeField and Description
private final RecursiveComparisonConfiguration
private final RecursiveComparisonDifferenceCalculator

Constructor Summary

AccessConstructor and Description
public
RecursiveComparator()

Returns a new RecursiveComparator that uses the default RecursiveComparisonConfiguration when comparing objects with the recursive comparison.

public
RecursiveComparator(RecursiveComparisonConfiguration
the RecursiveComparisonConfiguration instance to be used
recursiveComparisonConfiguration
)

Returns a new RecursiveComparator that uses the given RecursiveComparisonConfiguration when comparing objects with the recursive comparison.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

zero if the arguments are recursively equal to each other, or non-zero otherwise.
compare
(Object
the object to compare to other
actual
,
Object
the object to compare to actual
other
)

Implements java.util.Comparator.compare.

Returns zero if the arguments are recursively equal to each other, or non-zero otherwise (no ordering enforced).
private List<ComparisonDifference>
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

recursiveComparisonConfigurationback to summary
private final RecursiveComparisonConfiguration recursiveComparisonConfiguration
recursiveComparisonDifferenceCalculatorback to summary
private final RecursiveComparisonDifferenceCalculator recursiveComparisonDifferenceCalculator

Constructor Detail

RecursiveComparatorback to summary
public RecursiveComparator()

Returns a new RecursiveComparator that uses the default RecursiveComparisonConfiguration when comparing objects with the recursive comparison.

Since
3.25.0
RecursiveComparatorback to summary
public RecursiveComparator(RecursiveComparisonConfiguration recursiveComparisonConfiguration)

Returns a new RecursiveComparator that uses the given RecursiveComparisonConfiguration when comparing objects with the recursive comparison.

Parameters
recursiveComparisonConfiguration:RecursiveComparisonConfiguration

the RecursiveComparisonConfiguration instance to be used

Method Detail

compareback to summary
public int compare(Object actual, Object other)

Implements java.util.Comparator.compare.

Returns zero if the arguments are recursively equal to each other, or non-zero otherwise (no ordering enforced).

Parameters
actual:Object

the object to compare to other

other:Object

the object to compare to actual

Returns:int

zero if the arguments are recursively equal to each other, or non-zero otherwise.

Annotations
@Override
determineDifferencesWithback to summary
private List<ComparisonDifference> determineDifferencesWith(Object actual, Object expected)
getDescriptionback to summary
public String getDescription()