EnumSet<ArtifactKind> (boolean sources, boolean javadoc, String... artifactPackaging) { EnumSet<ArtifactKind> result = EnumSet.noneOf(ArtifactKind.class); if (sources) { result.add(SOURCES); } if (javadoc) { result.add(JAVADOC); } if (artifactPackaging.length == 0 || artifactPackaging.length == 1 && artifactPackaging[0] == null) { result.add(ARTIFACT); } else { for (String packaging : artifactPackaging) { final ArtifactKind artifact = find(ARTIFACT.getClassifier(), packaging); if (artifact != null) { result.add(artifact); } } } return result; }