Skip to content

Instantly share code, notes, and snippets.

@priyanshus
Created April 2, 2020 13:31
Show Gist options
  • Save priyanshus/a1ce2fe592a6ef78a78126d028d9daae to your computer and use it in GitHub Desktop.
Save priyanshus/a1ce2fe592a6ef78a78126d028d9daae to your computer and use it in GitHub Desktop.
public static void recursiveNode(JsonNode node) {
Iterator<Map.Entry<String, JsonNode>> it = node.fields();
if (node.isTextual() & node.toString().contains("sample")) {
System.out.println(node.toString());
}
while (it.hasNext()) {
JsonNode temp = it.next().getValue();
recursiveNode(temp);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment