I am trying to extend the following class using a constructor (from the Ektorp library):
public class CouchDbRepositorySupport<T extends CouchDbDocument> implements GenericRepository<T> { ... protected CouchDbRepositorySupport(Class<T> type, CouchDbConnector db) { ... }
Here is my implementation:
public class OrderRepository extends CouchDbRepositorySupport<Order<MenuItem>> { public OrderRepository(CouchDbConnector db) { super(Order<MenuItem>.class, db);
The problem with the Order<MenuItem>.class
. The Java compiler tells me:
Syntax error on token ">", void expected after this
I tried with (Order<MenuItem>).class
Order.class
, Order.class
and new Order<MenuItem>().getClass()
without any luck.
What can I do to get the .class attribute for a generic class?
source share