Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Support ObjectName patterns in excludeObjectNameAttributes
Signed-off-by: kgedminas <kgedminas@eisgroup.com>
  • Loading branch information
kgedminas-dot committed Dec 5, 2023
commit d91e13846ef940179a74739c7d452f29a71602fb
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,23 @@ public void add(ObjectName objectName, String attributeName) {
public boolean exclude(ObjectName objectName, String attributeName) {
boolean result = false;

// concrete objectName definition gets precedence
if (excludeObjectNameAttributesMap.size() > 0) {
Set<String> attributeNameSet = excludeObjectNameAttributesMap.get(objectName);
if (attributeNameSet != null) {
result = attributeNameSet.contains(attributeName);
return attributeNameSet.contains(attributeName);
}
}
for (Map.Entry<ObjectName, Set<String>> objectNameSetEntry :
excludeObjectNameAttributesMap.entrySet()) {
if (objectNameSetEntry.getKey().isPattern()
&& objectNameSetEntry.getKey().apply(objectName)) {
// if exclusion found - return
// otherwise keep searching as checked object may match multiple patterns
// and checked attribute may be defined only under one of them
if (objectNameSetEntry.getValue().contains(attributeName)) {
return true;
}
}
}

Expand Down