I have a JsonNode which looks like:
[
{
"ObjectIWantToRetrieve": {
"key0": {
"key1": {
"key2": "val3"
]
}
}
}
}
]
I wish to get the ObjectIWantToRetrieve out The equivalent of JsonNode.get("ObjectIWantToRetrieve"). Can anyone help me? Should I be converting the JSONNode to ArrayNode Please advice thank you
You should convert it to ObjectNode first like this :
ObjectNode value = ((ObjectNode) JsonNode.get(0)).get("ObjectIWantToRetrieve")