title: Constructor injection in data class
body: <p>I'm trying the following:</p>
  
  <pre><code>@Configuration 
  @ConfigurationProperties(prefix = "my")
  data class MyValueConfig(
      @Value("\${my.value1}") var value1: Int? = null,
      @Value("\${my.value2}") var value2: String? = null,
      @Value("\${my.value3}") var value3: String? = null
  )
  </code></pre>
  
  <p>Spring does not wire the value fields, they are null.
  Because Spring needs a default constructor my assumption was that I could provide it like this. Hence, the nullable types.</p>
  
  <p>This works because it is based on setter injection:</p>
  
  <pre><code>@Configuration 
  @ConfigurationProperties(prefix = "my")
  class MyValueConfig {
      @Value("\${my.value}") lateinit var value1: Int = 0   
      @Value("\${my.value2}") lateinit var value2: String
      @Value("\${my.value3}") lateinit var value3: String
  }
  </code></pre>
  
  <p>Is it possible to use constructor injection in kotlin using the <code>data class</code>?</p>