title: Kotlin equals and hash code generator
body: <p>I am aware that in Kotlin classes will have an equals and hashcode created automatically as follows:</p>
  
  <pre><code>data class CSVColumn(private val index: Int, val value: String) {
  }
  </code></pre>
  
  <p>My question is, is there a way to have the implementation just use one of these properties (such as <code>index</code>) without writing the code yourself. What was otherwise a very succinct class now looks like this:</p>
  
  <pre><code>data class CSVColumn(private val index: Int, val value: String) {
  
      override fun equals(other: Any?): Boolean {
          if (this === other) {
              return true
          }
          if (javaClass != other?.javaClass) {
              return false
          }
          other as CSVColumn
          if (index != other.index) {
              return false
          }
          return true
      }
  
      override fun hashCode(): Int {
          return index
      }
  
  }
  </code></pre>
  
  <p>In Java with Lombok, I can do something like:</p>
  
  <pre><code>@Value
  @EqualsAndHasCode(of="index")
  public class CsvColumn {
      private final int index;
      private final String value;
  }
  </code></pre>
  
  <p>Would be cool if there were a way to tell Kotlin something similar.</p>