by peterloveslucy · 10y ago · 0 comments
/**
* get the leaf node as a string
* @param obj the json object to operate on
* @param path the dot path to use
* @return the leaf node if present <b>and textual</b>, otherwise null
*/
public static String leafString(ObjectNode obj, String path) {
JsonNode leaf = leaf(obj, path);
return leaf != null && leaf.isTextual()
? leaf.asText()
: null;
}No comments yet.