1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 06:12:05 +01:00

OriginIdElement: Add proper equals() method

This commit is contained in:
Paul Schaub 2019-12-16 07:13:16 +01:00
parent 32ae0d8826
commit 72a9cb65a6

View file

@ -101,4 +101,25 @@ public class OriginIdElement extends StableAndUniqueIdElement {
.attribute(ATTR_ID, getId()) .attribute(ATTR_ID, getId())
.closeEmptyElement(); .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();
}
} }