aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/util
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-05-31 00:46:23 +0200
committernea <nea@nea.moe>2023-05-31 00:46:23 +0200
commita24a74fa2351d53693226ba0d0018fb9589cddc9 (patch)
tree4dc69bd90130f1755e75960251f5ca41701f84cf /src/main/kotlin/moe/nea/firmament/util
parent88cb9468b4432f68d1197f512f68c951fdbdf3dd (diff)
downloadFirmament-a24a74fa2351d53693226ba0d0018fb9589cddc9.tar.gz
Firmament-a24a74fa2351d53693226ba0d0018fb9589cddc9.tar.bz2
Firmament-a24a74fa2351d53693226ba0d0018fb9589cddc9.zip
[WIP] Add really shitty pv. This is mostly so I have something to be bothered to improve
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util')
-rw-r--r--src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt b/src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt
index c95b343..3dca217 100644
--- a/src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt
+++ b/src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt
@@ -2,7 +2,6 @@ package moe.nea.firmament.util.json
import java.util.UUID
import kotlinx.serialization.KSerializer
-import kotlinx.serialization.Serializer
import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
import kotlinx.serialization.descriptors.SerialDescriptor
@@ -15,7 +14,11 @@ object DashlessUUIDSerializer : KSerializer<UUID> {
PrimitiveSerialDescriptor("DashlessUUIDSerializer", PrimitiveKind.STRING)
override fun deserialize(decoder: Decoder): UUID {
- return parseDashlessUUID(decoder.decodeString())
+ val str = decoder.decodeString()
+ if ("-" in str) {
+ return UUID.fromString(str)
+ }
+ return parseDashlessUUID(str)
}
override fun serialize(encoder: Encoder, value: UUID) {