1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 04:17:59 +01:00

Fingerprint: Implement Comparable

This commit is contained in:
Heiko Schaefer 2023-06-30 19:26:48 +02:00 committed by Paul Schaub
parent dd4845d88d
commit 268afef1d3
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -4,7 +4,7 @@
package org.pgpainless.wot.dijkstra.sq package org.pgpainless.wot.dijkstra.sq
class Fingerprint(fingerprint: String) { class Fingerprint(fingerprint: String) : Comparable<Fingerprint> {
val fingerprint: String val fingerprint: String
@ -12,6 +12,10 @@ class Fingerprint(fingerprint: String) {
this.fingerprint = fingerprint.uppercase() this.fingerprint = fingerprint.uppercase()
} }
override fun compareTo(other: Fingerprint): Int {
return fingerprint.compareTo(other.fingerprint)
}
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
return other?.toString() == toString() return other?.toString() == toString()
} }