I have to crack a tough nut. Given the following interfaces:
interface Entity (... )
BaseInterface <e MyEntity> interface extends ... ( )
interface interface Special extends <e MyEntity> extends BaseInterface <E> {...}
Special interface and a suitable implementation this:
MyClazz <e MyEntity> class extends implements interface <E> (Special ... )
Now let I want to create the instances of MyClazz not yourself, but do these over a factory method:
public static <B extends BaseInterface <E>, E extends Entity> B getInstance (Class clazz <B>) (... )
The call currently looks like this:
Code:
Class cls = <SpecialInterface> SpecialInterface.class;
Special Interface <E> si = getInstance (cls);
si.doSth ();
Bookmarks