mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 20:37:59 +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
|
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()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue