ComparisonStrategyComparatorBasedComparisonStrategy, StandardComparisonStrategypublic abstract class AbstractComparisonStrategy extends Object implements ComparisonStrategy
ComparisonStrategy contract.| Constructor | Description |
|---|---|
AbstractComparisonStrategy() |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
arrayContains(Object array,
Object value) |
Returns true if given array contains given value according to the implemented comparison strategy, false otherwise.
|
abstract String |
asText() |
|
Iterable<?> |
duplicatesFrom(Iterable<?> iterable) |
Returns any duplicate elements from the given
Iterable 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 |
isStandard() |
Return true if comparison strategy is default/standard, false otherwise
|
protected abstract Set<Object> |
newSetUsingComparisonStrategy() |
Returns a
Set honoring the comparison strategy used. |
areEqual, isGreaterThan, iterableContains, iterableRemoves, iterablesRemoveFirst, stringContains, stringEndsWith, stringStartsWithpublic Iterable<?> duplicatesFrom(Iterable<?> iterable)
ComparisonStrategyIterable according to the implemented comparison strategy.duplicatesFrom in interface ComparisonStrategyiterable - 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 Set<Object> newSetUsingComparisonStrategy()
Set honoring the comparison strategy used.Set honoring the comparison strategy used.public boolean arrayContains(Object array, Object value)
ComparisonStrategyarrayContains in interface ComparisonStrategyarray - the array to search value in (must not be null)value - the object to look for in given arraypublic boolean isLessThan(Object actual, Object other)
ComparisonStrategyisLessThan in interface ComparisonStrategyactual - the object to compare to otherother - the object to compare to actualpublic boolean isLessThanOrEqualTo(Object actual, Object other)
ComparisonStrategyisLessThanOrEqualTo in interface ComparisonStrategyactual - the object to compare to otherother - the object to compare to actualpublic boolean isGreaterThanOrEqualTo(Object actual, Object other)
ComparisonStrategyisGreaterThanOrEqualTo in interface ComparisonStrategyactual - the object to compare to otherother - the object to compare to actualpublic abstract String asText()
public boolean isStandard()
ComparisonStrategyisStandard in interface ComparisonStrategyCopyright © 2014–2019. All rights reserved.