1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-15 17:02:06 +01:00

Fingerprint: Implement Comparable

This commit is contained in:
Heiko Schaefer 2023-06-30 19:26:48 +02:00
parent 461a2bebd4
commit 98fb643af6
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

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