Package org.assertj.core.internal
Class IterableElementComparisonStrategy<T>
- java.lang.Object
-
- org.assertj.core.internal.AbstractComparisonStrategy
-
- org.assertj.core.internal.StandardComparisonStrategy
-
- org.assertj.core.internal.IterableElementComparisonStrategy<T>
-
- All Implemented Interfaces:
ComparisonStrategy
public class IterableElementComparisonStrategy<T> extends StandardComparisonStrategy
-
-
Field Summary
Fields Modifier and Type Field Description private Comparator<? super T>
elementComparator
-
Constructor Summary
Constructors Constructor Description IterableElementComparisonStrategy(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(Iterable<T> actual, Iterable<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
-
IterableElementComparisonStrategy
public IterableElementComparisonStrategy(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
-
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
-
-