Skip to content
Snippets Groups Projects
Commit 00927bb7 authored by Koen's avatar Koen
Browse files

Added missing equality.

parent 5a61f4d0
No related branches found
No related tags found
No related merge requests found
...@@ -474,6 +474,22 @@ class ProcessSecret(val system: KeyPair, val process: Process) { ...@@ -474,6 +474,22 @@ class ProcessSecret(val system: KeyPair, val process: Process) {
return ProcessHandle(this, system.publicKey) return ProcessHandle(this, system.publicKey)
} }
override fun hashCode(): Int {
return combineHashCodes(listOf(system.hashCode(), process.hashCode()))
}
override fun toString(): String {
return "(system: $system, process: $process)"
}
override fun equals(other: Any?): Boolean {
if (other !is ProcessSecret) {
return false
}
return system == other.system && process == other.process
}
companion object { companion object {
fun fromProto(proto: Protocol.StorageTypeProcessSecret): ProcessSecret { fun fromProto(proto: Protocol.StorageTypeProcessSecret): ProcessSecret {
if (!proto.hasSystem()) { if (!proto.hasSystem()) {
...@@ -590,6 +606,18 @@ data class KeyPair(val privateKey: PrivateKey, val publicKey: PublicKey) { ...@@ -590,6 +606,18 @@ data class KeyPair(val privateKey: PrivateKey, val publicKey: PublicKey) {
return "(privateKey: $privateKey, publicKey: $publicKey)" return "(privateKey: $privateKey, publicKey: $publicKey)"
} }
override fun hashCode(): Int {
return combineHashCodes(listOf(privateKey.hashCode(), publicKey.hashCode()))
}
override fun equals(other: Any?): Boolean {
if (other !is KeyPair) {
return false
}
return privateKey == other.privateKey && publicKey == other.publicKey
}
companion object { companion object {
fun fromProto(proto: Protocol.KeyPair): KeyPair { fun fromProto(proto: Protocol.KeyPair): KeyPair {
return KeyPair( return KeyPair(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment