Package org.assertj.core.internal
Class AtomicReferenceArrayElementComparisonStrategy<T>
- java.lang.Object
-
- org.assertj.core.internal.AbstractComparisonStrategy
-
- org.assertj.core.internal.StandardComparisonStrategy
-
- org.assertj.core.internal.AtomicReferenceArrayElementComparisonStrategy<T>
-
- All Implemented Interfaces:
ComparisonStrategy
public class AtomicReferenceArrayElementComparisonStrategy<T> extends StandardComparisonStrategy
-
-
Field Summary
Fields Modifier and Type Field Description private Comparator<? super T>
elementComparator
-
Constructor Summary
Constructors Constructor Description AtomicReferenceArrayElementComparisonStrategy(Comparator<? super T> elementComparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areEqual(Object actual, Object other)
Returnstrue
if the arguments are deeply equal to each other,false
otherwise.String
asText()
private boolean
compareElementsOf(AtomicReferenceArray<T> actual, T[] other)
boolean
isStandard()
Return true if comparison strategy is default/standard, false otherwiseString
toString()
-
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 Detail
-
elementComparator
private final Comparator<? super T> elementComparator
-
-
Constructor Detail
-
AtomicReferenceArrayElementComparisonStrategy
public AtomicReferenceArrayElementComparisonStrategy(Comparator<? super T> elementComparator)
-
-
Method Detail
-
areEqual
public boolean areEqual(Object actual, Object other)
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:
- JDK-8196069
-
compareElementsOf
private boolean compareElementsOf(AtomicReferenceArray<T> actual, T[] other)
-
asText
public String asText()
- Overrides:
asText
in classStandardComparisonStrategy
-
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
-
-