Implementing equals and hashcode in PublicKey class

master
Nelson R. Perez 2016-12-18 17:20:05 -05:00
parent 5fa4d8667f
commit 4e2601e80f
1 changed files with 11 additions and 0 deletions

View File

@ -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());
}
}