2 ms·
the `<Book>` generic type doesn't translate to anything at run time, so you cannot actually parse the json out as a book class, unless you already knew it was g
by chii 5y ago
the `<Book>` generic type doesn't translate to anything at run time, so you cannot actually parse the json out as a book class, unless you already knew it was going to be a Book. The parse() method cannot be generic over all possible inputs as is - unless the user also pass in the `Book.class` parameter!
- vbezhenar 5y agoYou can use something like `new JsonParser<Book>(){}.parse(json)` Not saying that's a good idea, though.