ComparisonStrategy contract with a comparison strategy based on
java.util.Objects#deepEquals(Object, Object) method, it is also based on Comparable#compareTo(Object) when Object
are Comparable method.
| Modifier and Type | Field and Description |
|---|---|
| private static final StandardComparisonStrategy |
| Access | Constructor and Description |
|---|---|
| protected | StandardComparisonStrategy()
Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the arguments are deeply equal to each other, false otherwisethe object to compare to actual, Object otherthe object to compare to other)actualImplements org. true if the arguments are deeply equal to each other, false otherwise.
|
| private void | |
| public Iterable | duplicatesFrom(Iterable<?>
the given iterable)Iterable we want to extract duplicate elements.Overrides org. Implements org. java.
comparison strategy.
|
| public static StandardComparisonStrategy | Returns: the singleton instance of this class.Returns the singleton instance of this class. |
| public boolean | isGreaterThan(Object
the object to compare to other actual, Object the object to compare to actual other)Implements org. |
| public boolean | isLessThan(Object
the object to compare to other actual, Object the object to compare to actual other)Overrides org. Implements org. |
| public boolean | isStandard()
Overrides org. Implements org. |
| public boolean | Returns: true if givenIterable contains given value based on java.,
false otherwise.the iterable, Object Iterable to search value inthe object to look for in given value)IterableImplements org. Iterable contains given value based on java.,
false otherwise.
|
| public void | iterableRemoves(Iterable<?>
the iterable, Object Iterable we want remove value fromobject to remove from given value)IterableImplements org. Iterable according to the implemented comparison strategy, if value is found it is
removed from it.
|
| public void | iterablesRemoveFirst(Iterable<?>
the iterable, Object Iterable we want remove value fromobject to remove from given value)IterableImplements org. iterable that matches the value according to the implemented comparison
strategy.
|
| protected Set | newSetUsingComparisonStrategy()
Implements abstract org. Set honoring the comparison strategy used.
|
| public boolean | stringContains(String
the string to search sequence in (must not be null) string, String the String to look for in given string sequence)Implements org. |
| public boolean | stringEndsWith(String
the String we want to look starting suffix string, String the suffix String to look for at string's end suffix)Implements org. |
| public boolean | stringStartsWith(String
the String we want to look starting prefix string, String the prefix String to look for at string's start prefix)Implements org. |
| INSTANCE | back to summary |
|---|---|
| private static final StandardComparisonStrategy INSTANCE | |
| StandardComparisonStrategy | back to summary |
|---|---|
| protected StandardComparisonStrategy() Creates a new | |
| areEqual | back to summary |
|---|---|
| public boolean areEqual(Object actual, Object other) Implements org. Returns
It mimics the behavior of
| |
| checkArgumentIsComparable | back to summary |
|---|---|
| private void checkArgumentIsComparable(Object actual) | |
| duplicatesFrom | back to summary |
|---|---|
| public Iterable Overrides org. Implements org. Returns any duplicate elements from the given collection according to | |
| instance | back to summary |
|---|---|
| public static StandardComparisonStrategy instance() Returns the singleton instance of this class.
| |
| isGreaterThan | back to summary |
|---|---|
| public boolean isGreaterThan(Object actual, Object other) Implements org. Doc from org. Returns true if actual is greater than other, false otherwise.
| |
| isLessThan | back to summary |
|---|---|
| public boolean isLessThan(Object actual, Object other) Overrides org. Implements org. Doc from org. Returns true if actual is less than other, false otherwise.
| |
| isStandard | back to summary |
|---|---|
| public boolean isStandard() Overrides org. Implements org. Doc from org. Return true if comparison strategy is default/standard, false otherwise
| |
| iterableContains | back to summary |
|---|---|
| public boolean iterableContains(Iterable<?> iterable, Object value) Implements org. Returns true if given | |
| iterableRemoves | back to summary |
|---|---|
| public void iterableRemoves(Iterable<?> iterable, Object value) Implements org. Doc from org. Look for given value in given | |
| iterablesRemoveFirst | back to summary |
|---|---|
| public void iterablesRemoveFirst(Iterable<?> iterable, Object value) Implements org. Doc from org. Removes the first value in | |
| newSetUsingComparisonStrategy | back to summary |
|---|---|
| protected Set Implements abstract org. Doc from org. Returns a | |
| stringContains | back to summary |
|---|---|
| public boolean stringContains(String string, String sequence) Implements org. Doc from org. Returns true if given string contains given sequence according to the implemented comparison strategy, false otherwise. | |
| stringEndsWith | back to summary |
|---|---|
| public boolean stringEndsWith(String string, String suffix) Implements org. Doc from org. Returns true if string ends with suffix according to the implemented comparison strategy, false otherwise. | |
| stringStartsWith | back to summary |
|---|---|
| public boolean stringStartsWith(String string, String prefix) Implements org. Doc from org. Returns true if string starts with prefix according to the implemented comparison strategy, false otherwise. | |