| Start |
|---|
| Type-safe tree structure builder Builders can be defined as a set of extension functions taking lambda expressions with receivers as arguments. In this example, a menu of a These functions can then be used to build a tree structure of objects in an easy way: RemarksA type-safe builder is a concept, rather than a language feature, so it is not strictly formalized. A typical structure of a type-safe builderA single builder function usually consists of 3 steps:
Type-safe builders in Kotlin librariesThe concept of type-safe builders is widely used in some Kotlin libraries and frameworks, eg.:
|
Read Article
https://develop.horje.com/learn/1434/reference