Cześć potrzebuję w metodzie veryImportantThing użyć parametru typu Class.
public abstract class Something<T> {
public abstract Class<T> getGenericClass();
}
public class Example extends Something<Example> {
@Override
public Class<Example> getGenericClass() {
return Example.class;
}
}
public static abstract class BaseDao<T extends Something<T>> extends Amazing {
T type;
public T doSomething() {
** this.veryImportantMethod(type.getGenericClass()); **
}
}
public static class Son extends BaseDao<Example> {
}
Póki co dostaję coś w tylu ...read of unwritten field... NP_UNWRITTEN_FIELD
Ktoś wie jak to zrobić inaczej? Dzięki