Rainer Schlonvoigt
06/21/2021, 2:33 PM@Serializable(with=...)
on a Set of a custom class?
More specifically, my scenario looks like this:
@Serializable
data class MyClass(
@Serializable(with=???)
val mySet: Set<UUID>
)
where UUID is from java.util so i can’t annotate itRainer Schlonvoigt
06/21/2021, 2:34 PMdiesieben07
06/21/2021, 2:35 PM@file:UseSerializers(YourUUIDSerializer::class)
would be easiestRainer Schlonvoigt
06/21/2021, 2:39 PMRainer Schlonvoigt
06/21/2021, 2:39 PMephemient
06/22/2021, 4:26 AMval mySet: Set<@Serializable(with = MyUuidSerializer::class) UUID>
should work too, but @file:UseSerializers()
is easier if you have more than one instance in the fileRainer Schlonvoigt
06/22/2021, 7:00 AM