title: How to get generic parameter class in Kotlin
body: <p>Firebase's <code>snapshot.getValue()</code> expects to be called as follows:</p>
  
  <pre><code>snapshot?.getValue(Person::class.java)
  </code></pre>
  
  <p>However I would like to substitute <code>Person</code> with a generic parameter that is passed into the class via the class declaration i.e. </p>
  
  <pre><code>class DataQuery&lt;T : IModel&gt; 
  </code></pre>
  
  <p>and use that generic parameter to do something like this:</p>
  
  <pre><code>snapshot?.getValue(T::class.java)
  </code></pre>
  
  <p>but when I attempt that I get an error stating that </p>
  
  <blockquote>
    <p>only classes can be used on the left-hand side of a class literal</p>
  </blockquote>
  
  <p>Is it possible to provide a class constraint on the generic parameter like in C# or is there some other syntax I can use to get the type info for the generic param?</p>