I have this class
class X<T>{
public T dowhatever(){
//jackson parsing
ObjectMapper mapper = new ObjectMapper();
T obj = mapper.readValue(jsonString, T);
return obj;
}
}
But apparently, I can't pass T
to the readValue method. I need a class
information. Is there a way to generalize it without passing the Class
object as a paremeter?
p.s: I have omitted unnecessary code and left what is relevant.