title: What's the equivalent of T.class in a generic class?
body: <p>Consider the following generic converter class (simplified/incomplete for brevity)...</p>
  
  <pre><code>public abstract class BaseConverter &lt;TModel&gt;
  {
      public void convert(String data, Class&lt;TModel&gt; classOfModelType)
      {
      }
  
      public void convert(String data)
      {
          convert(data, TModel.class); // This doesn't work!
      }
  }
  </code></pre>
  
  <p>Externally in the subclass I can call the first <code>convert</code> without issue. Consider this subclass with <code>Car</code> as the generic type argument. I can pass in <code>Car.class</code>, like so...</p>
  
  <pre><code>public class CarConverter extends BaseConverter&lt;Car&gt;
  {
      public void someFunction()
      {
          String someString;
          convert(someString, Car.class);
      }
  }
  </code></pre>
  
  <p>What I'm trying to do is move as much as possible to the base class.  Since 'Car' is known here and therefore <code>convert</code> expects <code>Car.class</code>, and <code>TModel</code> represents <code>Car</code> in the base class (for this concrete BaseConverter anyway), I was trying to use <code>TModel.class</code> in the base class, but as stated, it doesn't work.</p>
  
  <p>So how do you achieve this in Java?</p>