Package de.danielbechler.diff.selector
Class CollectionItemElementSelector
java.lang.Object
de.danielbechler.diff.selector.ElementSelector
de.danielbechler.diff.selector.CollectionItemElementSelector
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopyWithIdentityStrategy(IdentityStrategy identityStrategy) booleanMust be implemented in a way so that this element can be distinguished from the other ones.getItem()Deprecated.Low-level API.inthashCode()Make sure to implement this properly.Methods inherited from class de.danielbechler.diff.selector.ElementSelector
toString
-
Constructor Details
-
CollectionItemElementSelector
Default implementation uses EqualsIdentityStrategy.- Parameters:
item-
-
-
Method Details
-
copyWithIdentityStrategy
-
getItem
Deprecated.Low-level API. Don't use in production code. May be removed in future versions. -
toHumanReadableString
- Specified by:
toHumanReadableStringin classElementSelector
-
equals
Description copied from class:ElementSelectorMust be implemented in a way so that this element can be distinguished from the other ones.- Specified by:
equalsin classElementSelector- Parameters:
o- The object to check equality against.- Returns:
trueis the given object equals this one, otherwisefalse.
-
hashCode
public int hashCode()Description copied from class:ElementSelectorMake sure to implement this properly. If two elements are equal, their hash code must be equal as well. However, it is absolutely okay if two unequal elements return the same hash code. A simple implementation could just return0.- Specified by:
hashCodein classElementSelector- Returns:
- The hash code of this element.
-