Jackson read json in generic List

Something which is much shorter:

mapper.readValue(jsonString, new TypeReference<List<EntryType>>() {});

Where EntryType is a reference to type you would like to hold within collection. It might be any Java class.
For example to read JSON representation such as ["a", "b", "c"] second argument to mapper should be new TypeReference<List<String>>() {}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)