public abstract class AbstractComparisonStrategy extends java.lang.Object implements ComparisonStrategy
ComparisonStrategy
contract.Constructor and Description |
---|
AbstractComparisonStrategy() |
Modifier and Type | Method and Description |
---|---|
boolean |
arrayContains(java.lang.Object array,
java.lang.Object value)
Returns true if given array contains given value according to the implemented comparison strategy, false otherwise.
|
abstract java.lang.String |
asText() |
java.lang.Iterable<?> |
duplicatesFrom(java.lang.Iterable<?> iterable)
Returns any duplicate elements from the given
Iterable according to the implemented comparison strategy. |
boolean |
isGreaterThanOrEqualTo(java.lang.Object actual,
java.lang.Object other)
Returns true if actual is greater than or equal to other, false otherwise.
|
boolean |
isLessThan(java.lang.Object actual,
java.lang.Object other)
Returns true if actual is less than other, false otherwise.
|
boolean |
isLessThanOrEqualTo(java.lang.Object actual,
java.lang.Object other)
Returns true if actual is less than or equal to other, false otherwise.
|
boolean |
isStandard()
Return true if comparison strategy is default/standard, false otherwise
|
protected abstract java.util.Set<java.lang.Object> |
newSetUsingComparisonStrategy()
Returns a
Set honoring the comparison strategy used. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
areEqual, isGreaterThan, iterableContains, iterableRemoves, stringContains, stringEndsWith, stringStartsWith
public java.lang.Iterable<?> duplicatesFrom(java.lang.Iterable<?> iterable)
ComparisonStrategy
Iterable
according to the implemented comparison strategy.duplicatesFrom
in interface ComparisonStrategy
iterable
- the given Iterable
we want to extract duplicate elements.Iterable
containing the duplicate elements of the given one. If no duplicates are found, an empty
Iterable
is returned.protected abstract java.util.Set<java.lang.Object> newSetUsingComparisonStrategy()
Set
honoring the comparison strategy used.Set
honoring the comparison strategy used.public boolean arrayContains(java.lang.Object array, java.lang.Object value)
ComparisonStrategy
arrayContains
in interface ComparisonStrategy
array
- the array to search value in (must not be null)value
- the object to look for in given arraypublic boolean isLessThan(java.lang.Object actual, java.lang.Object other)
ComparisonStrategy
isLessThan
in interface ComparisonStrategy
actual
- the object to compare to otherother
- the object to compare to actualpublic boolean isLessThanOrEqualTo(java.lang.Object actual, java.lang.Object other)
ComparisonStrategy
isLessThanOrEqualTo
in interface ComparisonStrategy
actual
- the object to compare to otherother
- the object to compare to actualpublic boolean isGreaterThanOrEqualTo(java.lang.Object actual, java.lang.Object other)
ComparisonStrategy
isGreaterThanOrEqualTo
in interface ComparisonStrategy
actual
- the object to compare to otherother
- the object to compare to actualpublic abstract java.lang.String asText()
public boolean isStandard()
ComparisonStrategy
isStandard
in interface ComparisonStrategy