Implementing equals and hashcode in PublicKey class
This commit is contained in:
parent
5fa4d8667f
commit
4e2601e80f
1 changed files with 11 additions and 0 deletions
|
@ -39,4 +39,15 @@ public class PublicKey implements ByteSerializable {
|
|||
}
|
||||
return new Address(pk).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return publicKey.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
PublicKey other = (PublicKey) obj;
|
||||
return this.publicKey.equals(other.getKey());
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue