![]() Martin Marconcini at 10:25 111.111.111.111 is not 'a big number' depending on your needs. ![]() I do want it to be possible to put a String and an Int into this list, at the same time. Ultimately, a 12-digit number is 'not very unique' depending on your needs (which you haven't provided) if it's for unique identifier, I'd use a UUID string, as the chances of collisions are very small. I'm not looking to support other objects. I only want to have Any be a String or a primitive. The elements that will be in this list are arguments for functions I will be calling. The args parameter is for a list of 'Any?'. But, I haven't found anything in the documentation, or any examples elsewhere, that look useful for what I'm trying to do. To use context serializer as fallback, explicitly annotate type or property with googled that I probably have to write a custom serializer and deserializer for this use case. IntelliJ gives me a red line on the 'Any?', and it says Serializer has not been found for type 'Any?'. This doesn't seem to work by default with Kotlin Serialization. I have a class that looks like this, class M圜lass( It's been pretty nice, but I've run into a pain point. 1 Answer Sorted by: 35 After following the Kotlin Custom Serializer section of the Kotlin Serialization Guide, I realized I had to write an object that looks like this to actually help the UUID serialize/ deserialize, even though UUID already implements java.io. ![]() I'm migrating a project from Gson to Kotlin Serialization.
0 Comments
Leave a Reply. |