polewpreview.blogg.se

Serializable kotlin data class
Serializable kotlin data class







Recently such functionality was implemented in Properties library.Īll code that you will see in this post can be found on github Let’s start!

serializable kotlin data class

Spoiler: we will try to reimplement deserialization library for map-like format using kotlin compiler. We will try to create a deserialization library for the deserialization of our map-like format. Let’s start from the most important thing: from documentation!Īctually rialization has perfect huge guide about the serialization.īut we will try to be short and practical. Let’s have a look how this framework works and try to write our own serializer. We know a lot of different libraries for the serialization in Java,īut in Kotlin it was decided to create a common framework for the serialization In general they can be split into two main groups:īinary protocols ( pickle, protobuf and many other)Īnd protocols with a string representation like json,Ĭsv, e.t.c.

serializable kotlin data class

There are a lot of different formats usedįor serialization. Of objects or sending these objects over the network.

serializable kotlin data class

Serialization and deserialization - are two sides of the same mechanism for storing (persisting) Writing our own compiler plugin for serialization using Kotlin









Serializable kotlin data class