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:
parent
32ae0d8826
commit
72a9cb65a6
1 changed files with 21 additions and 0 deletions
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue