By leveraging the Kotlin Language features of data classes, named parameters and default values, we can address the the majority of use cases that the Builder Pattern addresses for Java, but with much less code. I saw a Tweet by Hannes Dorfmann …
kotlin
Handling Optional Errors using Kotlin Sealed Classes
When calling a function which returns data, there is often the need to handle errors which might occur. This post details how to make use of Kotlin’s sealed classes to return one object which can represent the data you expected or an error. Let’s …