July 2018
Intermediate to advanced
242 pages
8h 6m
English
Destructuring declarations in Kotlin are position-based, opposed to property name-based declarations available in other languages. This means the Kotlin compiler decides which class property is linked to which variable based on the order of the properties. In order to allow custom class destructuring, we need to add implementations of the functions called componentN, where N refers to the component number marked with the operator keyword to allow using them in a destructuring declaration.
Read now
Unlock full access