public interface ComparisonStrategy
Modifier and Type | Method and Description |
---|---|
boolean |
areEqual(Object actual,
Object other)
Returns true if actual and other are equal according to the implemented comparison strategy.
|
boolean |
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 given
Iterable according to the implemented comparison strategy. |
boolean |
isGreaterThan(Object actual,
Object other)
Returns true if actual is greater than other, false otherwise.
|
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
|
boolean |
iterableContains(Iterable<?> collection,
Object value)
|
void |
iterableRemoves(Iterable<?> iterable,
Object value)
|
void |
iterablesRemoveFirst(Iterable<?> iterable,
Object value)
Removes the first value in
iterable that matches the value according to the implemented comparison
strategy. |
boolean |
stringContains(String string,
String sequence)
Returns true if given string contains given sequence according to the implemented comparison strategy, false otherwise.
|
boolean |
stringEndsWith(String string,
String suffix)
Returns true if string ends with suffix according to the implemented comparison strategy, false otherwise.
|
boolean |
stringStartsWith(String string,
String prefix)
Returns true if string starts with prefix according to the implemented comparison strategy, false otherwise.
|
boolean areEqual(Object actual, Object other)
actual
- the object to compare to otherother
- the object to compare to actualboolean isGreaterThan(Object actual, Object other)
actual
- the object to compare to otherother
- the object to compare to actualUnsupportedOperationException
- if operation is not supported by a concrete implementation.boolean isGreaterThanOrEqualTo(Object actual, Object other)
actual
- the object to compare to otherother
- the object to compare to actualUnsupportedOperationException
- if operation is not supported by a concrete implementation.boolean isLessThan(Object actual, Object other)
actual
- the object to compare to otherother
- the object to compare to actualUnsupportedOperationException
- if operation is not supported by a concrete implementation.boolean isLessThanOrEqualTo(Object actual, Object other)
actual
- the object to compare to otherother
- the object to compare to actualUnsupportedOperationException
- if operation is not supported by a concrete implementation.void iterablesRemoveFirst(Iterable<?> iterable, Object value)
iterable
that matches the value
according to the implemented comparison
strategy. If given Iterable
is null, does nothing.Iterable<?> duplicatesFrom(Iterable<?> iterable)
Iterable
according to the implemented comparison strategy.boolean arrayContains(Object array, Object value)
array
- the array to search value in (must not be null)value
- the object to look for in given arrayboolean stringContains(String string, String sequence)
string
- the string to search sequence in (must not be null)sequence
- the String to look for in given stringboolean stringStartsWith(String string, String prefix)
string
- the String we want to look starting prefixprefix
- the prefix String to look for at string's startboolean stringEndsWith(String string, String suffix)
string
- the String we want to look starting suffixsuffix
- the suffix String to look for at string's endboolean isStandard()
Copyright © 2014–2019 AssertJ. All rights reserved.