1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.jadira.dependencynavigator.model;
19
20 import java.util.ArrayList;
21 import java.util.List;
22
23 public class ExclusionList {
24 private List<String> exclusions;
25
26 public void addExclusion(String groupId, String artifactId) {
27 if (exclusions == null) {
28
29 exclusions = new ArrayList<String>();
30 }
31 String exclusion = groupId + ":" + artifactId;
32 if (!exclusions.contains(exclusion)) {
33 exclusions.add(exclusion);
34 }
35 }
36
37 public boolean isExcluded(String groupId, String artifactId) {
38 String identifier = groupId + ":" + artifactId;
39 if (exclusions != null) {
40 for (String exclusion : exclusions) {
41 if (exclusion.equalsIgnoreCase(identifier)) {
42 return true;
43 }
44 }
45 }
46 return false;
47 }
48 }