December 2017
Intermediate to advanced
260 pages
7h 34m
English
One of the coolest features in Kotlin is data classes. All pain that we used to take to create and maintain plain old Java object (POJO) classes in Java is gone. No need to have those dedicated packages to hold your model class. Any Kotlin file can hold your data class. By default it provides you methods such as toString(), equals(), copy(), and hashCode() method implementation. In Android, we mostly use this type of class to hold our JSON responses in form of model classes. You can check out data classes we created in DataClasses.kt. The following code snippet is an extract of the DataClasses.kt file:
data class LinkedInUser(val id: String, val firstName: String, val lastName: String, val headline: String, val siteStandardProfileRequest ...
Read now
Unlock full access