mirror of
https://github.com/sparrowwallet/drongo.git
synced 2025-11-05 11:56:38 +00:00
override equals and hashcode for sp address
This commit is contained in:
parent
da736c8cef
commit
7c0aa1545d
1 changed files with 22 additions and 0 deletions
|
|
@ -56,4 +56,26 @@ public class SilentPaymentAddress {
|
||||||
|
|
||||||
return new SilentPaymentAddress(scanPubKey, spendPubKey);
|
return new SilentPaymentAddress(scanPubKey, spendPubKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getAddress();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final boolean equals(Object o) {
|
||||||
|
if(this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(!(o instanceof SilentPaymentAddress that)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return getAddress().equals(that.getAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return getAddress().hashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue