https://kotlinlang.org logo
a

a_wer1986

03/02/2017, 2:00 PM
@menegatti You can override properties in data class, e.g. open class BaseEntity(open var id: Long, open var owner: String) data class Post(override var id: Long, override var owner: String, var title: String, var postedAt: Date) : BaseEntity(id, owner) in this case these properties will be presented in toString(), equals(), etc results. If you don't want or it's not needed - just pass to parent constructor as common args: open class BaseEntity(var id: Long, var owner: String) data class Post(id: Long, owner: String, var title: String, var postedAt: Date) : BaseEntity(id, owner)