From b71ee7552276bf149989c9481bb96b61114c4062 Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Mon, 18 Mar 2024 21:29:14 +0000 Subject: [PATCH] Add comments around ConfigItemChanges methods Signed-off-by: Peter Nied --- .../security/dlic/rest/api/ConfigUpgradeApiAction.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/opensearch/security/dlic/rest/api/ConfigUpgradeApiAction.java b/src/main/java/org/opensearch/security/dlic/rest/api/ConfigUpgradeApiAction.java index 2d04b72892..f295ab8c1c 100644 --- a/src/main/java/org/opensearch/security/dlic/rest/api/ConfigUpgradeApiAction.java +++ b/src/main/java/org/opensearch/security/dlic/rest/api/ConfigUpgradeApiAction.java @@ -365,6 +365,7 @@ public boolean hasChanges() { return !itemsGroupedByOperation.isEmpty(); } + /** Adds the config item changes to the json node */ public void addToNode(final ObjectNode node) { final var allOperations = JsonNodeFactory.instance.objectNode(); itemsGroupedByOperation.forEach((operation, items) -> { @@ -374,6 +375,10 @@ public void addToNode(final ObjectNode node) { node.set(config.toLCString(), allOperations); } + /** + * Classifies the changes to this config into groupings by the type of change, for + * multiple changes types on the same item they are groupped as 'modify' + */ private static Map> classifyChanges(final JsonNode differences) { final var items = new HashMap(); differences.forEach(node -> {