Package de.danielbechler.diff.selector
Class ElementSelector
java.lang.Object
de.danielbechler.diff.selector.ElementSelector
- Direct Known Subclasses:
BeanPropertyElementSelector,CollectionItemElementSelector,MapKeyElementSelector,RootElementSelector
Serves mainly as marker class and enforces the proper implementation of hashCode(), equals() and toString()
for all element selectors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanMust be implemented in a way so that this element can be distinguished from the other ones.abstract inthashCode()Make sure to implement this properly.abstract Stringfinal StringtoString()The string representation will only be used to print readable property paths for debug purposes.
-
Constructor Details
-
ElementSelector
public ElementSelector()
-
-
Method Details
-
toHumanReadableString
-
equals
Must be implemented in a way so that this element can be distinguished from the other ones. -
hashCode
public abstract int hashCode()Make 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. -
toString
The string representation will only be used to print readable property paths for debug purposes.
-