summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormojahidi <mojahidul.islam@amdocs.com>2018-01-04 12:43:22 +0530
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-01-04 10:46:58 +0000
commita895663a3eaa0d068d138d2f429593fd59dc75b3 (patch)
tree765aa62235a16fadef72f706e01f8d5110625c78
parent9c41c5111dd09f0d9ae22a09c40970e28e5e1894 (diff)
Fixed sonar issues - MapValidationResponseToDto
Removed commented code Change-Id: I2dc73201a53947d68031000f80251a6b29798bfb Issue-ID: SDC-343 Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java57
1 files changed, 8 insertions, 49 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
index 85b5567ed6..722bb556be 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
@@ -1,21 +1,17 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
*/
package org.openecomp.sdcrests.vsp.rest.mapping;
@@ -52,7 +48,7 @@ public class MapValidationResponseToDto
return null;
}
return uploadDataErrors.entrySet().stream().collect(
- Collectors.toMap(entry -> entry.getKey(), entry -> mapErrorMessages(entry.getValue())));
+ Collectors.toMap(Map.Entry::getKey, entry -> mapErrorMessages(entry.getValue())));
}
private static QuestionnaireValidationResultDto mapQuestionnaireValidationResult(
@@ -68,51 +64,14 @@ public class MapValidationResponseToDto
Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
for (CompositionEntityValidationData validationData : questionnaireValidationResult
.getValidationData()) {
- validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping
- (validationData, CompositionEntityValidationDataDto.class));
+ validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping(
+ validationData, CompositionEntityValidationDataDto.class));
}
questionnaireValidationResultDto.setValidationData(validationDataDto);
return questionnaireValidationResultDto;
}
- /*private static ComponentValidationResultDto mapcomponentValidationResult(
- ComponentValidationResult componentValidationResult) {
- if (componentValidationResult == null) {
- return null;
- }
- ComponentValidationResultDto componentValidationResultDto =
- new ComponentValidationResultDto();
- componentValidationResultDto.setValid(componentValidationResult.isValid());
-
- Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
- for(CompositionEntityValidationData validationData : componentValidationResult.getInfo()){
- validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping
- (validationData, CompositionEntityValidationDataDto.class));
- }
-
- componentValidationResultDto.setValidationData(validationDataDto);
- return componentValidationResultDto;
- }
-
- private static DeploymentFlavorValidationResultDto mapdeploymentFlavorValidationResult(
- DeploymentFlavorValidationResult deploymentFlavorValidationResult) {
- if (deploymentFlavorValidationResult == null) {
- return null;
- }
- DeploymentFlavorValidationResultDto deploymentFlavorValidationResultDto =
- new DeploymentFlavorValidationResultDto();
- deploymentFlavorValidationResultDto.setValid(deploymentFlavorValidationResult.isValid());
-
- Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
- for(CompositionEntityValidationData validationData : deploymentFlavorValidationResult.getInfo()){
- validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping
- (validationData, CompositionEntityValidationDataDto.class));
- }
-
- deploymentFlavorValidationResultDto.setValidationData(validationDataDto);
- return deploymentFlavorValidationResultDto;
- }*/
private static List<ErrorMessageDto> mapErrorMessages(List<ErrorMessage> errorMessages) {
return errorMessages == null ? null : errorMessages.stream().map(