Basically I want to create a method that has a signature like the following:
public <T> T getShellTab(Class<T extends ShellTab> shellTabClass)
but this isn't valid Java.
I want to be able to pass a class that is a subclass of ShellTab
and have an instance of that class returned.
public <T> T getShellTab(Class<T> shellTabClass)
works fine, but I would like to force shellTabClass
to be a subclass of ShellTab
.
Any ideas on how to pull this off?
Thank you.