Search in sources :

Example 1 with BuildPatternArtifactsRequestBuilder

use of org.jfrog.build.api.builder.dependency.BuildPatternArtifactsRequestBuilder in project build-info by JFrogDev.

the class BuildDependenciesHelper method toArtifactsRequests.

private List<BuildPatternArtifactsRequest> toArtifactsRequests(Map<String, Map<String, List<BuildDependencyPattern>>> dependencyPatterns) {
    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;
}
Also used : List(java.util.List) BuildDependencyPattern(org.jfrog.build.api.dependency.pattern.BuildDependencyPattern) BuildPatternArtifactsRequestBuilder(org.jfrog.build.api.builder.dependency.BuildPatternArtifactsRequestBuilder)

Aggregations

List (java.util.List)1 BuildPatternArtifactsRequestBuilder (org.jfrog.build.api.builder.dependency.BuildPatternArtifactsRequestBuilder)1 BuildDependencyPattern (org.jfrog.build.api.dependency.pattern.BuildDependencyPattern)1