From aa9374ba5aa7a8fb46a3a646d0bae375f67776e0 Mon Sep 17 00:00:00 2001 From: Matt Wright Date: Sat, 9 Dec 2023 09:00:34 -0500 Subject: [PATCH] Remove unnecessary hashCode impl --- .../src/main/kotlin/com/acme/scheduling/Appointment.kt | 4 ---- .../src/main/kotlin/com/acme/scheduling/Client.kt | 5 +---- .../src/main/kotlin/com/acme/scheduling/Practice.kt | 6 +----- .../src/main/kotlin/com/acme/scheduling/Practitioner.kt | 6 +----- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Appointment.kt b/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Appointment.kt index 8ab29ba..5d4e8a6 100644 --- a/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Appointment.kt +++ b/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Appointment.kt @@ -22,10 +22,6 @@ data class Appointment( fun cancel() = copy(state = AppointmentState.CANCELED) - override fun hashCode(): Int { - return id.hashCode() - } - @JvmInline @Serializable value class Id(val value: String) diff --git a/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Client.kt b/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Client.kt index ae971e9..7dab3fb 100644 --- a/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Client.kt +++ b/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Client.kt @@ -10,10 +10,7 @@ data class Client( val gender: Gender, val contactPoints: Set = emptySet(), ) : Identifiable { - override fun hashCode(): Int { - return id.hashCode() - } - + @JvmInline @Serializable value class Id(val value: String) diff --git a/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Practice.kt b/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Practice.kt index 2a861f4..8bb4226 100644 --- a/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Practice.kt +++ b/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Practice.kt @@ -10,11 +10,7 @@ data class Practice( val name: Name, val contactPoints: Set, ) : Identifiable { - - override fun hashCode(): Int { - return id.hashCode() - } - + @JvmInline @Serializable value class Id(val value: String) diff --git a/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Practitioner.kt b/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Practitioner.kt index 1f98937..1ef553e 100644 --- a/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Practitioner.kt +++ b/acme-domain/acme-domain-scheduling/src/main/kotlin/com/acme/scheduling/Practitioner.kt @@ -11,11 +11,7 @@ data class Practitioner( val gender: Gender, val contactPoints: Set = emptySet(), ) : Identifiable { - - override fun hashCode(): Int { - return id.hashCode() - } - + @JvmInline @Serializable value class Id(val value: String)