DeepDifference but takes a RecursiveComparisonConfiguration, DeepDifference
being itself based on the deep equals implementation of https://github.com/jdereg/java-util
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private static final String | |
| private static final Map | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | areDualValueEqual(DualValue dualValue, RecursiveComparisonConfiguration recursiveComparisonConfiguration)
|
| private static boolean | areEqualUsingComparator(final Object actual, final Object expected, Comparator<Object> comparator, String fieldName)
|
| private static void | compareArrays(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareAsEnums(final DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareAtomicBoolean(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareAtomicInteger(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareAtomicIntegerArray(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareAtomicLong(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareAtomicLongArray(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareAtomicReference(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareAtomicReferenceArray(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareOptional(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareOrderedCollections(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static <K, V> void | compareSortedMap(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareUnorderedIterables(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static void | compareUnorderedMap(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static String | |
| public List | Returns: the list of differences found or an empty list if objects are equivalent. Equivalent means that all field values of both subgraphs are the same, either at the field level or via the respectively encountered overridden .equals() methods during traversal.Object one to compare actual, Object Object two to compare expected, RecursiveComparisonConfiguration the recursive comparison configuration recursiveComparisonConfiguration)Compare two objects for differences by doing a 'deep' comparison. |
| private static List | determineDifferences(Object actual, Object expected, FieldLocation fieldLocation, VisitedDualValues visitedDualValues, RecursiveComparisonConfiguration recursiveComparisonConfiguration)
|
| private static String | |
| private static void | enumComparedToDifferentTypeError(DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static ComparisonDifference | |
| private static boolean | |
| private static boolean | |
| private static String | |
| pack-priv static boolean | Returns: true, if the passed in Class has a .equals() method somewhere between itself and just below Object in it's inheritance.Class to check. c)Determine if the passed in class has a non-Object.equals() method. |
| private static boolean | |
| private static FieldLocation | |
| private static boolean | searchIterableForElement(Iterator<?> actualIterator, Object expectedElement, DualValue dualValue, RecursiveComparisonDifferenceCalculator.
|
| private static boolean | shouldHonorEquals(DualValue dualValue, RecursiveComparisonConfiguration recursiveComparisonConfiguration)
|
| private static boolean | shouldHonorOverriddenEquals(DualValue dualValue, RecursiveComparisonConfiguration recursiveComparisonConfiguration)
|
| ACTUAL_IS_AN_ENUM_WHILE_EXPECTED_IS_NOT | back to summary |
|---|---|
| private static final String ACTUAL_IS_AN_ENUM_WHILE_EXPECTED_IS_NOT | |
| ACTUAL_NOT_ORDERED_COLLECTION | back to summary |
|---|---|
| private static final String ACTUAL_NOT_ORDERED_COLLECTION | |
| ARRAY_FIELD_NAME | back to summary |
|---|---|
| private static final String ARRAY_FIELD_NAME | |
| customEquals | back to summary |
|---|---|
| private static final Map<Class<?>, Boolean> customEquals | |
| DIFFERENT_ACTUAL_AND_EXPECTED_FIELD_TYPES | back to summary |
|---|---|
| private static final String DIFFERENT_ACTUAL_AND_EXPECTED_FIELD_TYPES | |
| DIFFERENT_SIZE_ERROR | back to summary |
|---|---|
| private static final String DIFFERENT_SIZE_ERROR | |
| MISSING_FIELDS | back to summary |
|---|---|
| private static final String MISSING_FIELDS | |
| STRICT_TYPE_ERROR | back to summary |
|---|---|
| private static final String STRICT_TYPE_ERROR | |
| VALUE_FIELD_NAME | back to summary |
|---|---|
| private static final String VALUE_FIELD_NAME | |
| RecursiveComparisonDifferenceCalculator | back to summary |
|---|---|
| public RecursiveComparisonDifferenceCalculator() | |
| areDualValueEqual | back to summary |
|---|---|
private static boolean areDualValueEqual(DualValue dualValue, RecursiveComparisonConfiguration recursiveComparisonConfiguration)
| |
| areEqualUsingComparator | back to summary |
|---|---|
| private static boolean areEqualUsingComparator(final Object actual, final Object expected, Comparator<Object> comparator, String fieldName) | |
| compareArrays | back to summary |
|---|---|
| private static void compareArrays(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareAsEnums | back to summary |
|---|---|
| private static void compareAsEnums(final DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareAtomicBoolean | back to summary |
|---|---|
| private static void compareAtomicBoolean(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareAtomicInteger | back to summary |
|---|---|
| private static void compareAtomicInteger(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareAtomicIntegerArray | back to summary |
|---|---|
| private static void compareAtomicIntegerArray(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareAtomicLong | back to summary |
|---|---|
| private static void compareAtomicLong(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareAtomicLongArray | back to summary |
|---|---|
| private static void compareAtomicLongArray(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareAtomicReference | back to summary |
|---|---|
| private static void compareAtomicReference(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareAtomicReferenceArray | back to summary |
|---|---|
| private static void compareAtomicReferenceArray(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareOptional | back to summary |
|---|---|
| private static void compareOptional(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareOrderedCollections | back to summary |
|---|---|
| private static void compareOrderedCollections(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareSortedMap | back to summary |
|---|---|
| private static <K, V> void compareSortedMap(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareUnorderedIterables | back to summary |
|---|---|
| private static void compareUnorderedIterables(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| compareUnorderedMap | back to summary |
|---|---|
| private static void compareUnorderedMap(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| describeOrderedCollectionTypes | back to summary |
|---|---|
| private static String describeOrderedCollectionTypes() | |
| determineDifferences | back to summary |
|---|---|
| public List Compare two objects for differences by doing a 'deep' comparison. This will traverse the Object graph and perform either a field-by-field comparison on each object (if not .equals() method has been overridden from Object), or it will call the customized .equals() method if it exists. 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.
| |
| determineDifferences | back to summary |
|---|---|
| private static List | |
| differentTypeErrorMessage | back to summary |
|---|---|
| private static String differentTypeErrorMessage(DualValue dualValue, String actualTypeDescription) | |
| enumComparedToDifferentTypeError | back to summary |
|---|---|
| private static void enumComparedToDifferentTypeError(DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| expectedAndActualTypeDifference | back to summary |
|---|---|
| private static ComparisonDifference expectedAndActualTypeDifference(Object actual, Object expected) | |
| expectedTypeIsNotSubtypeOfActualType | back to summary |
|---|---|
| private static boolean expectedTypeIsNotSubtypeOfActualType(DualValue dualField) | |
| expectedTypeIsNotSubtypeOfActualType | back to summary |
|---|---|
| private static boolean expectedTypeIsNotSubtypeOfActualType(Object actual, Object expected) | |
| getChildFieldForValidation | back to summary |
|---|---|
| private static String getChildFieldForValidation(FieldLocation field, FieldLocation fieldValue) | |
| hasOverriddenEquals | back to summary |
|---|---|
| pack-priv static boolean hasOverriddenEquals(Class<?> c) Determine if the passed in class has a non-Object.equals() method. This method caches its results in static ConcurrentHashMap to benefit execution performance.
| |
| isChildOfSpecifiedComparatorField | back to summary |
|---|---|
| private static boolean isChildOfSpecifiedComparatorField(DualValue dualValue, FieldLocation field) | |
| keyFieldLocation | back to summary |
|---|---|
| private static FieldLocation keyFieldLocation(FieldLocation parentFieldLocation, Object key) | |
| searchIterableForElement | back to summary |
|---|---|
| private static boolean searchIterableForElement(Iterator<?> actualIterator, Object expectedElement, DualValue dualValue, RecursiveComparisonDifferenceCalculator. | |
| shouldHonorEquals | back to summary |
|---|---|
| private static boolean shouldHonorEquals(DualValue dualValue, RecursiveComparisonConfiguration recursiveComparisonConfiguration) | |
| shouldHonorOverriddenEquals | back to summary |
|---|---|
| private static boolean shouldHonorOverriddenEquals(DualValue dualValue, RecursiveComparisonConfiguration recursiveComparisonConfiguration) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv List | |
| pack-priv DualValueDeque | |
| pack-priv RecursiveComparisonConfiguration | |
| pack-priv VisitedDualValues |
| Access | Constructor and Description |
|---|---|
| public | ComparisonState(VisitedDualValues visitedDualValues, RecursiveComparisonConfiguration recursiveComparisonConfiguration)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| private String | |
| public List | |
| public boolean | |
| private void | |
| private boolean | |
| public DualValue | |
| private void |
| differences | back to summary |
|---|---|
| pack-priv List<ComparisonDifference> differences | |
| dualValuesToCompare | back to summary |
|---|---|
| pack-priv DualValueDeque dualValuesToCompare | |
| recursiveComparisonConfiguration | back to summary |
|---|---|
| pack-priv RecursiveComparisonConfiguration recursiveComparisonConfiguration | |
| visitedDualValues | back to summary |
|---|---|
| pack-priv VisitedDualValues visitedDualValues | |
| ComparisonState | back to summary |
|---|---|
| public ComparisonState(VisitedDualValues visitedDualValues, RecursiveComparisonConfiguration recursiveComparisonConfiguration) | |
| addDifference | back to summary |
|---|---|
| pack-priv void addDifference(DualValue dualValue) | |
| addDifference | back to summary |
|---|---|
| pack-priv void addDifference(DualValue dualValue, String description) | |
| addKeyDifference | back to summary |
|---|---|
| pack-priv void addKeyDifference(DualValue parentDualValue, Object actualKey, Object expectedKey) | |
| getCustomErrorMessage | back to summary |
|---|---|
| private String getCustomErrorMessage(DualValue dualValue) | |
| getDifferences | back to summary |
|---|---|
| public List | |
| hasDualValuesToCompare | back to summary |
|---|---|
| public boolean hasDualValuesToCompare() | |
| initDualValuesToCompare | back to summary |
|---|---|
| private void initDualValuesToCompare(Object actual, Object expected, FieldLocation nodeLocation) | |
| mustCompareNodesRecursively | back to summary |
|---|---|
| private boolean mustCompareNodesRecursively(DualValue dualValue) | |
| pickDualValueToCompare | back to summary |
|---|---|
| public DualValue pickDualValueToCompare() | |
| registerForComparison | back to summary |
|---|---|
| private void registerForComparison(DualValue dualValue) | |