List<BuildPatternArtifactsRequest> artifactsRequests = Lists.newLinkedList();
for (String buildName : dependencyPatterns.keySet()) {
Map<String, List<BuildDependencyPattern>> buildNumbers = dependencyPatterns.get(buildName);
for (String buildNumber : buildNumbers.keySet()) {
List<BuildDependencyPattern> buildDependencyPatterns = buildNumbers.get(buildNumber);
BuildPatternArtifactsRequestBuilder builder = new BuildPatternArtifactsRequestBuilder()
.buildName(buildName).buildNumber(buildNumber);
for (BuildDependencyPattern buildDependencyPattern : buildDependencyPatterns) {
builder.pattern(buildDependencyPattern.getPattern());
}
artifactsRequests.add(builder.build());
}
}
return artifactsRequests;
}