Search in sources :

Example 1 with DetectCodeLocationType

use of com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocationType in project hub-detect by blackducksoftware.

the class CodeLocationDependencyCounter method aggregateCountsByGroup.

public Map<DetectCodeLocationType, Integer> aggregateCountsByGroup(final Map<DetectCodeLocation, Integer> codeLocations) {
    final Map<DetectCodeLocationType, Integer> dependencyCounts = new HashMap<>();
    for (final Entry<DetectCodeLocation, Integer> countEntry : codeLocations.entrySet()) {
        final DetectCodeLocationType group = countEntry.getKey().getCodeLocationType();
        if (!dependencyCounts.containsKey(group)) {
            dependencyCounts.put(group, 0);
        }
        dependencyCounts.put(group, dependencyCounts.get(group) + countEntry.getValue());
    }
    return dependencyCounts;
}
Also used : HashMap(java.util.HashMap) DetectCodeLocation(com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocation) DetectCodeLocationType(com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocationType)

Example 2 with DetectCodeLocationType

use of com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocationType in project hub-detect by blackducksoftware.

the class CodeLocationReporter method writeBomToolCounts.

private void writeBomToolCounts(final ReportWriter writer, final Map<DetectCodeLocationType, Integer> dependencyCounts) {
    for (final DetectCodeLocationType group : dependencyCounts.keySet()) {
        final Integer count = dependencyCounts.get(group);
        writer.writeLine(group.toString() + " : " + count);
    }
}
Also used : DetectCodeLocationType(com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocationType)

Aggregations

DetectCodeLocationType (com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocationType)2 DetectCodeLocation (com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocation)1 HashMap (java.util.HashMap)1