title: How to access fields of a Generic type in Kotlin?
body: <p>I have a Generic class.</p>
  <pre><code>class GenericsClassExample&lt;T&gt;(
          var data: T
  )
  </code></pre>
  <p>I have another class which I'm passing in place of T.</p>
  <pre><code>data class MyDataClass1(val id: String, val value: String) 
  </code></pre>
  <p>And I'm instantiating Generic Class like :</p>
  <pre><code>val genericClass = GenericClass&lt;MyDataClass1&gt;()
  </code></pre>
  <p>I would like to know how to access the fields (<code>id</code> and <code>value</code>) from <code>genericClass</code> object without knowing the type of the class I'm passing, i.e. I could also pass another class like <code>MyDataClass1</code> say <code>MyDataClass2</code> which also has its own fields.</p>