From 0fafc90d87470ec870262adde846e8796286ae8b Mon Sep 17 00:00:00 2001 From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de> Date: Fri, 22 Jan 2021 11:46:45 +0100 Subject: [PATCH] use data classes --- .../main/kotlin/theodolite/util/LoadDimension.kt | 12 +----------- .../src/main/kotlin/theodolite/util/Resource.kt | 13 +------------ 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/LoadDimension.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/LoadDimension.kt index 6a3953b6b..ba1facf34 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/LoadDimension.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/LoadDimension.kt @@ -1,17 +1,7 @@ package theodolite.util -class LoadDimension(val number: Int) { // data class ? +data class LoadDimension(val number: Int) { public fun get(): Int { return this.number; } - public override fun equals(other: Any?): Boolean { - if (other is LoadDimension) { - return this.get() == other.get() - } - return false - } - - override fun hashCode(): Int { - return this.get().hashCode() - } } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/Resource.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/Resource.kt index 9d1478c47..d17a9daff 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/Resource.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/Resource.kt @@ -1,18 +1,7 @@ package theodolite.util -class Resource(val number: Int) { +data class Resource(val number: Int) { public fun get(): Int { return this.number; } - - public override fun equals(other: Any?): Boolean { - if (other is Resource) { - return this.get() == other.get() - } - return false - } - - override fun hashCode(): Int { - return this.get().hashCode() - } } \ No newline at end of file -- GitLab