public class AtomicReferenceArrayElementComparisonStrategy<T> extends StandardComparisonStrategy
| Constructor and Description |
|---|
AtomicReferenceArrayElementComparisonStrategy(Comparator<? super T> elementComparator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areEqual(Object actual,
Object other)
Returns
true if the arguments are deeply equal to each other, false otherwise. |
String |
asText()
Used in error messages when a custom comparison strategy was used to compare values.
|
boolean |
isStandard()
Return true if comparison strategy is default/standard, false otherwise
|
String |
toString() |
duplicatesFrom, instance, isGreaterThan, isLessThan, iterableContains, iterableRemoves, iterablesRemoveFirst, newSetUsingComparisonStrategy, stringContains, stringEndsWith, stringStartsWitharrayContains, isGreaterThanOrEqualTo, isLessThanOrEqualTopublic AtomicReferenceArrayElementComparisonStrategy(Comparator<? super T> elementComparator)
public boolean areEqual(Object actual, Object other)
StandardComparisonStrategytrue 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 to deepEquals javadoc, the reference check should be delegated
to the equals method of the first argument, but this is not happening. Bug JDK-8196069 also
mentions this gap.
areEqual in interface ComparisonStrategyareEqual in class StandardComparisonStrategyactual - the object to compare to otherother - the object to compare to actualtrue if the arguments are deeply equal to each other, false otherwisepublic String asText()
ComparisonStrategy
For example ComparatorBasedComparisonStrategy returns:
"when comparing values using " + toString()public boolean isStandard()
ComparisonStrategyisStandard in interface ComparisonStrategyisStandard in class StandardComparisonStrategyCopyright © 2025. All rights reserved.