Package org.assertj.core.internal
Class ObjectArrayElementComparisonStrategy<T>
java.lang.Object
org.assertj.core.internal.AbstractComparisonStrategy
org.assertj.core.internal.StandardComparisonStrategy
org.assertj.core.internal.ObjectArrayElementComparisonStrategy<T>
- All Implemented Interfaces:
ComparisonStrategy
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionObjectArrayElementComparisonStrategy
(Comparator<? super T> elementComparator) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if the arguments are deeply equal to each other,false
otherwise.asText()
Used in error messages when a custom comparison strategy was used to compare values.private boolean
compareElementsOf
(T[] actual, T[] other) boolean
Return true if comparison strategy is default/standard, false otherwisetoString()
Methods inherited from class org.assertj.core.internal.StandardComparisonStrategy
duplicatesFrom, instance, isGreaterThan, isLessThan, iterableContains, iterableRemoves, iterablesRemoveFirst, newSetUsingComparisonStrategy, stringContains, stringEndsWith, stringStartsWith
Methods inherited from class org.assertj.core.internal.AbstractComparisonStrategy
arrayContains, isGreaterThanOrEqualTo, isLessThanOrEqualTo
-
Field Details
-
elementComparator
-
-
Constructor Details
-
ObjectArrayElementComparisonStrategy
-
-
Method Details
-
areEqual
Description copied from class:StandardComparisonStrategy
Returnstrue
if the arguments are deeply equal to each other,false
otherwise.It mimics the behavior of
Objects.deepEquals(Object, Object)
, but without performing a reference check between the two arguments. According todeepEquals
javadoc, the reference check should be delegated to theequals
method of the first argument, but this is not happening. Bug JDK-8196069 also mentions this gap.- Specified by:
areEqual
in interfaceComparisonStrategy
- Overrides:
areEqual
in classStandardComparisonStrategy
- Parameters:
actual
- the object to compare toother
other
- the object to compare toactual
- Returns:
true
if the arguments are deeply equal to each other,false
otherwise- See Also:
-
compareElementsOf
-
toString
-
asText
Description copied from interface:ComparisonStrategy
Used in error messages when a custom comparison strategy was used to compare values.For example
ComparatorBasedComparisonStrategy
returns:"when comparing values using " + toString()
- Returns:
- the comparison strategy description used in error messages.
-
isStandard
public boolean isStandard()Description copied from interface:ComparisonStrategy
Return true if comparison strategy is default/standard, false otherwise- Specified by:
isStandard
in interfaceComparisonStrategy
- Overrides:
isStandard
in classStandardComparisonStrategy
- Returns:
- true if comparison strategy is default/standard, false otherwise
-