de.danielbechler.diff.path
Class CollectionElement
java.lang.Object
de.danielbechler.diff.path.Element
de.danielbechler.diff.path.CollectionElement
public final class CollectionElement
- extends Element
- Author:
- Daniel Bechler
Method Summary |
boolean |
equals(Object o)
Must be implemented in a way so that this element can be distinguished from the other ones. |
Object |
getItem()
|
int |
hashCode()
Make sure to implement this properly. |
String |
toString()
The string representation will only be used to print readable property paths for debug purposes. |
CollectionElement
public CollectionElement(Object item)
getItem
public Object getItem()
equals
public boolean equals(Object o)
- Description copied from class:
Element
- Must be implemented in a way so that this element can be distinguished from the other ones.
- Specified by:
equals
in class Element
- Parameters:
o
- The object to check equality against.
- Returns:
true
is the given object equals this one, otherwise false
.
hashCode
public int hashCode()
- Description copied from class:
Element
- 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 return
0
.
- Specified by:
hashCode
in class Element
- Returns:
- The hash code of this element.
toString
public String toString()
- Description copied from class:
Element
- The string representation will only be used to print readable property paths for debug purposes.
- Specified by:
toString
in class Element
- Returns:
- A string representation of this element for debug purposes.
Copyright © 2012. All Rights Reserved.