Skip to content

Commit

Permalink
Add comments around ConfigItemChanges methods
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <petern@amazon.com>
  • Loading branch information
peternied committed Mar 18, 2024
1 parent c40f46f commit b71ee75
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> {
Expand All @@ -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<String, List<String>> classifyChanges(final JsonNode differences) {
final var items = new HashMap<String, String>();
differences.forEach(node -> {
Expand Down

0 comments on commit b71ee75

Please sign in to comment.