use of org.sonarqube.ws.WsMeasures.Component in project sonarqube by SonarSource.
the class ComponentDtoToWsComponent method componentDtoToWsComponent.
static Component.Builder componentDtoToWsComponent(ComponentDto component, Map<MetricDto, MeasureDto> measuresByMetric, Map<String, ComponentDto> referenceComponentsByUuid) {
Component.Builder wsComponent = componentDtoToWsComponent(component);
ComponentDto referenceComponent = referenceComponentsByUuid.get(component.getCopyResourceUuid());
if (referenceComponent != null) {
wsComponent.setRefId(referenceComponent.uuid());
wsComponent.setRefKey(referenceComponent.key());
}
for (Map.Entry<MetricDto, MeasureDto> entry : measuresByMetric.entrySet()) {
wsComponent.addMeasures(measureDtoToWsMeasure(entry.getKey(), entry.getValue()));
}
return wsComponent;
}
Aggregations