Please assist, I checked Jackson JsonNode but I can’t seem to find what am looking for.
I need to know how to get
// Example : I can get int value like : ObjectMapper mapper = new ObjectMapper(); final JsonNode data =mapper.readTree(json); Int myNumberInt = data.get ("ngNumberInt").asInt();
LocalDate, how do I get it from
In my mind, am wishing there was
LocalDate dateCreated = data.get ("ngDate").asLocalDate();
JsonNode methods will only give you the JSON data types. However you can use your ObjectMapper instance to deserialize a LocalDate.
You will need to include
jackson-modules-java8 if you haven’t already. This includes a serializer/deserializer for Java’s LocalDate.
Answered By – Gorazd Rebolj