java.lang.Object
org.sentrysoftware.metricshub.engine.connector.parser.AbstractJsonNodeUpdater
org.sentrysoftware.metricshub.engine.connector.parser.JsonNodeUpdater

public class JsonNodeUpdater extends AbstractJsonNodeUpdater
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 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 the JsonNodeUpdater.
      Parameters:
      jsonNode - JsonNode object 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.