How do I refer {}
in java. Is it a new object or class or datatype or something else?
I am going through some code in json to object conversion. It uses com.fasterxml.jackson.core.type.TypeReference
. I would like to understand what is {}
. Because methods always accepts object. When I do new XXX()
then creation of object is done. So what is the need of extra {}
?
try {
return objectMapper.readValue(dbData, new TypeReference<List<MyClass>>() {});
} catch (IOException e) {
LOGGER.error("Exception while de-serializing", e);
return Collections.emptyList();
}