aws-networkfirewall-firewallpolicy/src/main/java/software/amazon/networkfirewall/firewallpolicy/TagUtils.java [22:43]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.desiredStackTags = desiredStackTags;
        this.previousStackTags = previousStackTags;

        this.tagsDiff = computeTagsDiff();
    }

    // tags to add contains both new tags and exiting tag with new value
    public Map<String, String> tagsToAddOrUpdate() {
        Map<String, String> tagsToAdd = new HashMap<>(tagsDiff.entriesOnlyOnRight());
        // get the tags for those value has changed
        tagsDiff.entriesDiffering().forEach((k, v) -> tagsToAdd.put(k, v.rightValue()));

        return tagsToAdd;
    }

    public Map<String, String> tagsToRemove() {
        return tagsDiff.entriesOnlyOnLeft();
    }

    private MapDifference<String, String> computeTagsDiff() {
        // desired resource request tags and stack tags.
        Map<String, String> desiredTags = convertTags(desiredStackTags);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-networkfirewall-rulegroup/src/main/java/software/amazon/networkfirewall/rulegroup/TagUtils.java [22:43]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.desiredStackTags = desiredStackTags;
        this.previousStackTags = previousStackTags;

        this.tagsDiff = computeTagsDiff();
    }

    // tags to add contains both new tags and existing tag with new value
    public Map<String, String> tagsToAddOrUpdate() {
        Map<String, String> tagsToAdd = new HashMap<>(tagsDiff.entriesOnlyOnRight());
        // get the tags for those value has changed
        tagsDiff.entriesDiffering().forEach((k, v) -> tagsToAdd.put(k, v.rightValue()));

        return tagsToAdd;
    }

    public Map<String, String> tagsToRemove() {
        return tagsDiff.entriesOnlyOnLeft();
    }

    private MapDifference<String, String> computeTagsDiff() {
        // desired resource request tags and stack tags.
        Map<String, String> desiredTags = convertTags(desiredStackTags);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



