public static String stringify ( final JsonNode json ) { try { return json != null ? createObjectMapper ( ) . writeValueAsString ( json ) : "{}" ; } catch ( JsonProcessingException jpx ) { throw new RuntimeException ( "A problem occurred while stringifying a JsonNode: " + jpx . getMessage ( ) , jpx ) ; } }
Convert a JsonNode to its string representation . If given value is null an empty json object will returned .