Class JsonNodeUpdater
java.lang.Object
org.sentrysoftware.metricshub.engine.connector.parser.AbstractJsonNodeUpdater
org.sentrysoftware.metricshub.engine.connector.parser.JsonNodeUpdater
This utility class traverses a JsonNode, applying updates according to an
updater function and a predicate that determines whether the value should be
updated.
-
Constructor Summary
ConstructorsConstructorDescriptionJsonNodeUpdater(@NonNull com.fasterxml.jackson.databind.JsonNode jsonNode, @NonNull Predicate<String> predicate, @NonNull UnaryOperator<String> updater) Constructs a new instance of theJsonNodeUpdater. -
Method Summary
Modifier and TypeMethodDescriptionvoidupdate()Traverse the current JsonNode, applying the updater to each JsonNode child when the predicate evaluates to true, indicating that the value should be updated.
-
Constructor Details
-
JsonNodeUpdater
public JsonNodeUpdater(@NonNull @NonNull com.fasterxml.jackson.databind.JsonNode jsonNode, @NonNull @NonNull Predicate<String> predicate, @NonNull @NonNull UnaryOperator<String> updater) Constructs a new instance of theJsonNodeUpdater.- Parameters:
jsonNode-JsonNodeobject to update.predicate- Update condition function.updater- Function performing an update of a string value.
-
-
Method Details
-
update
public void update()Traverse the current JsonNode, applying the updater to each JsonNode child when the predicate evaluates to true, indicating that the value should be updated.
-