OriginIdElement: Add proper equals() method

This commit is contained in:
Paul Schaub 2019-12-16 07:13:16 +01:00
parent 32ae0d8826
commit 72a9cb65a6
1 changed files with 21 additions and 0 deletions

View File

@ -101,4 +101,25 @@ public class OriginIdElement extends StableAndUniqueIdElement {
.attribute(ATTR_ID, getId())
.closeEmptyElement();
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null) {
return false;
}
if (!(other instanceof OriginIdElement)) {
return false;
}
OriginIdElement otherId = (OriginIdElement) other;
return getId().equals(otherId.getId());
}
@Override
public int hashCode() {
return getId().hashCode();
}
}