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:
parent
461a2bebd4
commit
98fb643af6
1 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue