title: Retrieve the .class attribute of a generic class
body: <p>I am trying to extend the following class with constructor (from the Ektorp library): </p>
  
  <pre><code>public class CouchDbRepositorySupport&lt;T extends CouchDbDocument&gt; implements GenericRepository&lt;T&gt; {
  
  ...
  
  protected CouchDbRepositorySupport(Class&lt;T&gt; type, CouchDbConnector db) {
  ...
  
  }
  </code></pre>
  
  <p>Here's my implementation:</p>
  
  <pre><code>public class OrderRepository extends CouchDbRepositorySupport&lt;Order&lt;MenuItem&gt;&gt; {
  
      public OrderRepository(CouchDbConnector db) {
          super(Order&lt;MenuItem&gt;.class, db);
  </code></pre>
  
  <p>The problem is with the <code>Order&lt;MenuItem&gt;.class</code> part. The Java compiler tells me: </p>
  
  <pre><code> Syntax error on token "&gt;", void expected after this 
  </code></pre>
  
  <p>I tried with <code>(Order&lt;MenuItem&gt;).class</code>, <code>Order.class</code> and <code>new Order&lt;MenuItem&gt;().getClass()</code> with no better luck.</p>
  
  <p>What can I do to retrieve the .class attribute of a generic class?</p>