From 7fa2875f94d5005aa34823af91ce4df73da5627d Mon Sep 17 00:00:00 2001 From: y9vad9 Date: Sun, 11 Jun 2023 16:26:13 +0200 Subject: [PATCH] feat: type-safe creation failure exceptions are now data-classes --- .../timemates/sdk/common/constructor/CreationFailure.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/src/commonMain/kotlin/io/timemates/sdk/common/constructor/CreationFailure.kt b/sdk/src/commonMain/kotlin/io/timemates/sdk/common/constructor/CreationFailure.kt index e9d3d3a..8eac3fc 100644 --- a/sdk/src/commonMain/kotlin/io/timemates/sdk/common/constructor/CreationFailure.kt +++ b/sdk/src/commonMain/kotlin/io/timemates/sdk/common/constructor/CreationFailure.kt @@ -16,17 +16,17 @@ public sealed class CreationFailure(message: String) : TimeMatesException(messag /** * Represents a creation failure due to a size range constraint. */ - public class SizeRangeFailure(public val range: IntRange) : CreationFailure("Constraint failure: size must be in range of $range") + public data class SizeRangeFailure(public val range: IntRange) : CreationFailure("Constraint failure: size must be in range of $range") /** * Represents a creation failure due to an exact size constraint. */ - public class SizeExactFailure(public val size: Int) : CreationFailure("Constraint failure: size must be exactly $size") + public data class SizeExactFailure(public val size: Int) : CreationFailure("Constraint failure: size must be exactly $size") /** * Represents a creation failure due to a minimum value constraint. */ - public class MinValueFailure(public val size: Int) : CreationFailure("Constraint failure: minimal value is $size") + public data class MinValueFailure(public val size: Int) : CreationFailure("Constraint failure: minimal value is $size") /** * Represents a creation failure due to a blank value constraint. @@ -36,7 +36,7 @@ public sealed class CreationFailure(message: String) : TimeMatesException(messag /** * Represents a creation failure due to a pattern constraint. */ - public class PatternFailure(public val regex: Regex) : CreationFailure("Constraint failure: input should match $regex") + public data class PatternFailure(public val regex: Regex) : CreationFailure("Constraint failure: input should match $regex") public companion object { /**