Jackson – Deserialize using generic class

I have a json string, which I should deSerialize to the following class

class Data <T> {
    int found;
    Class<T> hits
}

How do I do it?
This is the usual way

mapper.readValue(jsonString, Data.class);

But how do I mention what T stands for?

10 Answers
10

Leave a Comment