jeudi 28 février 2019

How to implement Java step Builder pattern in Kotlin

In my current Android project I am investigating the use of Kotlin. I am rewriting a 100% Java Android app to 100% Kotlin. I'm stuck with attempting to implement my Java step builders though. These are useful as they force the user to populate all required variables before they can execute the associated function/command. I cannot find any examples of how to achieve this in Kotlin, does Kotlin have a better alternative that ensures a class has all it's fields populated before a function can be executed?

Aucun commentaire:

Enregistrer un commentaire