I've used Java for quite some time now, but some things are still not very clear to me, especially when it comes to generics...
Here's the thing: I have this Search
class that I'm using (see here for details), that is constructed like this:
public Search(Class<?> searchClass) {...}
Further more, I have a parametrized generic wrapper around this, as follows:
public class HibernateSearch<E> extends Search implements Serializable {
public HibernateSearch(Class<E> entityClass) {
super(entityClass);
}
// ... omitted for brevity
}
Now, what I need is the following: I'd like to create parametrized class, that contains this class as its field, e.g.
public class BaseSelectorComposer<T> extends SelectorComposer<Window> {
private HibernateSearch<T> searchObject;
...
@Override
public void doAfterCompose(Window comp) throws Exception {
super.doAfterCompose(comp);
this.searchObject =
new HibernateSearchObject<T>( now what...??? );
...
}
...
}
I think that the problem I'm facing is obvious from the given example.
Can someone advise what can be done here, or some alternative ?