From 98fb643af6ce34ba9ac613c5ac660dbbd885a68a Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Fri, 30 Jun 2023 19:26:48 +0200 Subject: [PATCH] Fingerprint: Implement Comparable --- .../kotlin/org/pgpainless/wot/dijkstra/sq/Fingerprint.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Fingerprint.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Fingerprint.kt index e37b6935..f05b4ff6 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Fingerprint.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Fingerprint.kt @@ -4,7 +4,7 @@ package org.pgpainless.wot.dijkstra.sq -class Fingerprint(fingerprint: String) { +class Fingerprint(fingerprint: String) : Comparable { 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() }