I had posted the question wrongly. I am posting the question correctly here ...
I am getting a json string as a HTTP response. I know the structure of it. It is as
You will need to build JavaType explicitly, if generic type is only dynamically available:
// do NOT create new ObjectMapper per each request!
final ObjectMapper mapper = new ObjectMapper();
public Json void deSerialize(Class clazz, InputStream json) {
return mapper.readValue(json,
mapper.getTypeFactory().constructParametricType(Json.class, clazz));
}