updateJsonNode

public static void updateJsonNode(ObjectNode currentObject, String keyToSet, JsonNode valueNode)

Updates a JSON node with a new value, handling potential conflicts.

Parameters

currentObject

The ObjectNode to update.

keyToSet

The key to set in the ObjectNode.

valueNode

The new JsonNode value.

Throws

if a value cannot be set for an existing key.