Package org.assertj.core.internal
Class AbstractComparisonStrategy
java.lang.Object
org.assertj.core.internal.AbstractComparisonStrategy
- All Implemented Interfaces:
ComparisonStrategy
- Direct Known Subclasses:
ComparatorBasedComparisonStrategy
,StandardComparisonStrategy
Base implementation of
ComparisonStrategy
contract.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
arrayContains
(Object array, Object value) Returns true if given array contains given value according to the implemented comparison strategy, false otherwise.Iterable
<?> duplicatesFrom
(Iterable<?> iterable) Returns any duplicate elements from the givenIterable
according to the implemented comparison strategy.boolean
isGreaterThanOrEqualTo
(Object actual, Object other) Returns true if actual is greater than or equal to other, false otherwise.boolean
isLessThan
(Object actual, Object other) Returns true if actual is less than other, false otherwise.boolean
isLessThanOrEqualTo
(Object actual, Object other) Returns true if actual is less than or equal to other, false otherwise.boolean
Return true if comparison strategy is default/standard, false otherwiseReturns aSet
honoring the comparison strategy used.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.assertj.core.internal.ComparisonStrategy
areEqual, asText, isGreaterThan, iterableContains, iterableRemoves, iterablesRemoveFirst, stringContains, stringEndsWith, stringStartsWith
-
Constructor Details
-
AbstractComparisonStrategy
public AbstractComparisonStrategy()
-
-
Method Details
-
duplicatesFrom
Description copied from interface:ComparisonStrategy
Returns any duplicate elements from the givenIterable
according to the implemented comparison strategy.- Specified by:
duplicatesFrom
in interfaceComparisonStrategy
- Parameters:
iterable
- the givenIterable
we want to extract duplicate elements.- Returns:
- an
Iterable
containing the duplicate elements of the given one. If no duplicates are found, an emptyIterable
is returned.
-
newSetUsingComparisonStrategy
Returns aSet
honoring the comparison strategy used.- Returns:
- a
Set
honoring the comparison strategy used.
-
arrayContains
Description copied from interface:ComparisonStrategy
Returns true if given array contains given value according to the implemented comparison strategy, false otherwise.- Specified by:
arrayContains
in interfaceComparisonStrategy
- Parameters:
array
- the array to search value in (must not be null)value
- the object to look for in given array- Returns:
- true if given array contains given value according to the implemented comparison strategy, false otherwise.
-
isLessThan
Description copied from interface:ComparisonStrategy
Returns true if actual is less than other, false otherwise.- Specified by:
isLessThan
in interfaceComparisonStrategy
- Parameters:
actual
- the object to compare to otherother
- the object to compare to actual- Returns:
- true if actual is less than other, false otherwise.
-
isLessThanOrEqualTo
Description copied from interface:ComparisonStrategy
Returns true if actual is less than or equal to other, false otherwise.- Specified by:
isLessThanOrEqualTo
in interfaceComparisonStrategy
- Parameters:
actual
- the object to compare to otherother
- the object to compare to actual- Returns:
- true if actual is less than or equal to other, false otherwise.
-
isGreaterThanOrEqualTo
Description copied from interface:ComparisonStrategy
Returns true if actual is greater than or equal to other, false otherwise.- Specified by:
isGreaterThanOrEqualTo
in interfaceComparisonStrategy
- Parameters:
actual
- the object to compare to otherother
- the object to compare to actual- Returns:
- true if actual is greater than or equal to other, false otherwise.
-
isStandard
public boolean isStandard()Description copied from interface:ComparisonStrategy
Return true if comparison strategy is default/standard, false otherwise- Specified by:
isStandard
in interfaceComparisonStrategy
- Returns:
- true if comparison strategy is default/standard, false otherwise
-