Closed mmaryo closed 5 years ago
I would like to do
public <T> void method(String body, Class<T> clazz) { JsonIterator.deserialize(body, new TypeLiteral<List<clazz>>(){}); }
Is there other way to use Class ?
With Jackson we can do TypeFactory.defaultInstance().constructParametrizedType(ArrayList.class, List.class, clazz));
TypeFactory.defaultInstance().constructParametrizedType(ArrayList.class, List.class, clazz));
I would like to do
public <T> void method(String body, Class<T> clazz) { JsonIterator.deserialize(body, new TypeLiteral<List<clazz>>(){}); }
Is there other way to use Class ?
With Jackson we can do
TypeFactory.defaultInstance().constructParametrizedType(ArrayList.class, List.class, clazz));