Probably a stupid question, but googling doesn’t g...
# serialization
r
Probably a stupid question, but googling doesn’t get me anywhere 😕 Can i easily use
Copy code
@Serializable(with=...)
on a Set of a custom class? More specifically, my scenario looks like this:
Copy code
@Serializable
data class MyClass(
    @Serializable(with=???)
    val mySet: Set<UUID>
)
where UUID is from java.util so i can’t annotate it
i did write a KSerializer for UUID, but is there a cheap way to make it work with the Set?
d
I think
@file:UseSerializers(YourUUIDSerializer::class)
would be easiest
r
oh, didn’t know that one, yet
thank you, will give it a try! 🙂
e
val mySet: Set<@Serializable(with = MyUuidSerializer::class) UUID>
should work too, but
@file:UseSerializers()
is easier if you have more than one instance in the file
r
it works! thank you guys