Data classes | Kotlin

The compiler automatically derives the following members from all properties declared in the primary constructor:

To ensure consistency and meaningful behavior of the generated code, data classes have to fulfill the following requirements: