Package org.assertj.core.internal
Class AbstractComparisonStrategy
- java.lang.Object
-
- org.assertj.core.internal.AbstractComparisonStrategy
-
- All Implemented Interfaces:
ComparisonStrategy
- Direct Known Subclasses:
ComparatorBasedComparisonStrategy,StandardComparisonStrategy
public abstract class AbstractComparisonStrategy extends Object implements ComparisonStrategy
Base implementation ofComparisonStrategycontract.- Author:
- Joel Costigliola
-
-
Constructor Summary
Constructors Constructor Description AbstractComparisonStrategy()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanarrayContains(Object array, Object value)Returns true if given array contains given value according to the implemented comparison strategy, false otherwise.abstract StringasText()Iterable<?>duplicatesFrom(Iterable<?> iterable)Returns any duplicate elements from the givenIterableaccording to the implemented comparison strategy.booleanisGreaterThanOrEqualTo(Object actual, Object other)Returns true if actual is greater than or equal to other, false otherwise.booleanisLessThan(Object actual, Object other)Returns true if actual is less than other, false otherwise.booleanisLessThanOrEqualTo(Object actual, Object other)Returns true if actual is less than or equal to other, false otherwise.booleanisStandard()Return true if comparison strategy is default/standard, false otherwiseprotected abstract Set<Object>newSetUsingComparisonStrategy()Returns aSethonoring 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, isGreaterThan, iterableContains, iterableRemoves, iterablesRemoveFirst, stringContains, stringEndsWith, stringStartsWith
-
-
-
-
Method Detail
-
duplicatesFrom
public Iterable<?> duplicatesFrom(Iterable<?> iterable)
Description copied from interface:ComparisonStrategyReturns any duplicate elements from the givenIterableaccording to the implemented comparison strategy.- Specified by:
duplicatesFromin interfaceComparisonStrategy- Parameters:
iterable- the givenIterablewe want to extract duplicate elements.- Returns:
- an
Iterablecontaining the duplicate elements of the given one. If no duplicates are found, an emptyIterableis returned.
-
newSetUsingComparisonStrategy
protected abstract Set<Object> newSetUsingComparisonStrategy()
Returns aSethonoring the comparison strategy used.- Returns:
- a
Sethonoring the comparison strategy used.
-
arrayContains
public boolean arrayContains(Object array, Object value)
Description copied from interface:ComparisonStrategyReturns true if given array contains given value according to the implemented comparison strategy, false otherwise.- Specified by:
arrayContainsin 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
public boolean isLessThan(Object actual, Object other)
Description copied from interface:ComparisonStrategyReturns true if actual is less than other, false otherwise.- Specified by:
isLessThanin 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
public boolean isLessThanOrEqualTo(Object actual, Object other)
Description copied from interface:ComparisonStrategyReturns true if actual is less than or equal to other, false otherwise.- Specified by:
isLessThanOrEqualToin 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
public boolean isGreaterThanOrEqualTo(Object actual, Object other)
Description copied from interface:ComparisonStrategyReturns true if actual is greater than or equal to other, false otherwise.- Specified by:
isGreaterThanOrEqualToin 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.
-
asText
public abstract String asText()
-
isStandard
public boolean isStandard()
Description copied from interface:ComparisonStrategyReturn true if comparison strategy is default/standard, false otherwise- Specified by:
isStandardin interfaceComparisonStrategy- Returns:
- true if comparison strategy is default/standard, false otherwise
-
-