title: Property include/exclude on Kotlin data classes
body: <p>Suppose I only want one or two fields to be included in the generated equals and hashCode implementations (or perhaps exclude one or more fields).  For a simple class, e.g.:</p>
  <pre><code>data class Person(val id: String, val name: String)
  </code></pre>
  <p>Groovy has this:</p>
  <pre><code>@EqualsAndHashCode(includes = 'id')
  </code></pre>
  <p>Lombok has this:</p>
  <pre><code>@EqualsAndHashCode(of = &quot;id&quot;)
  </code></pre>
  <p>What is the idiomatic way of doing this in Kotlin?</p>
  <h3>My approach so far</h3>
  <pre><code>data class Person(val id: String) {
     // at least we can guarantee it is present at access time
     var name: String by Delegates.notNull()
  
     constructor(id: String, name: String): this(id) {
        this.name = name
     }
  }
  </code></pre>
  <p>Just feels wrong though... I don't really want <code>name</code> to be mutable, and the extra constructor definition is ugly.</p>