lundi 21 mars 2016

Builder class in Kotlin?

Hi I am a newbie in the Kotlin world. I like what I see so far and started to think to convert some of our libraries we use in our application from Java to Kotlin.

These libraries are full of Pojos with setters, getters and Builder classes. Now I have googled to find what is the best way to implement Builders in Kotlin but no success. I am not sure if it is even needed since the constructor could handle default values and some stuff like "null check" is not needed by the builder, but some things like a little more advanced validation of the fields for example is a must.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire