Class RecursiveComparator

java.lang.Object
org.assertj.core.api.recursive.comparison.RecursiveComparator
All Implemented Interfaces:
Comparator<Object>

public class RecursiveComparator extends Object implements 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 Details

    • RecursiveComparator

      public RecursiveComparator(RecursiveComparisonConfiguration recursiveComparisonConfiguration)
      Returns a new RecursiveComparator that uses the given RecursiveComparisonConfiguration when comparing objects with the recursive comparison.
      Parameters:
      recursiveComparisonConfiguration - the used RecursiveComparisonConfiguration
  • Method Details

    • compare

      public int compare(Object actual, Object other)
      Returns 0 if the arguments are recursively equal to each other, a non-zero otherwise (no ordering enforced).
      Specified by:
      compare in interface Comparator<Object>
      Parameters:
      actual - the object to compare to other
      other - the object to compare to actual
      Returns:
      0 if the arguments are recursively equal to each other, a non-zero otherwise.
    • getDescription

      public String getDescription()