mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-05 03:55:58 +01:00
Fingerprint: Implement Comparable
This commit is contained in:
parent
dd4845d88d
commit
268afef1d3
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