aboutsummaryrefslogtreecommitdiffstats
path: root/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
diff options
context:
space:
mode:
Diffstat (limited to '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')
-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/MapComponentDataToComponentDto.java15
-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/MapComponentDependencyEntityToCreationDto.java18
-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/MapComponentDependencyEntityToDto.java23
-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/MapComponentDependencyModelEntityToDto.java21
-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/MapComponentDependencyModelRequestToEntity.java31
-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/MapComponentEntityToComponentCreationDto.java17
-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/MapComponentEntityToComponentDto.java20
-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/MapComponentRequestDtoToComponentEntity.java21
-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/MapCompositionEntityResponseToDto.java36
-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/MapCompositionEntityValidationDataToDto.java33
-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/MapComputeDataToComputeDetailsDto.java16
-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/MapComputeDetailsDtoToComputeEntity.java14
-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/MapComputeEntityToComputeCreationDto.java17
-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/MapComputeEntityToComputeDto.java25
-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/MapComputeEntityToVspComputeDto.java23
-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/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.java26
-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/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.java18
-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/MapDeploymentFlavorEntityToDeploymentFlavorDto.java13
-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/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.java26
-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/MapDeploymentFlavorToDeploymentDto.java21
-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/MapFilesDataStructureToDto.java22
-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/MapImageDataToImageDto.java22
-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/MapImageEntityToImageCreationDto.java16
-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/MapImageEntityToImageDto.java21
-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/MapImageRequestDtoToImageEntity.java16
-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/MapItemToVspDetailsDto.java28
-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/MapMonitoringUploadStatusToDto.java21
-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/MapNetworkEntityToNetworkDto.java20
-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/MapNetworkRequestDtoToNetworkEntity.java23
-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/MapNetworkToNetworkDto.java16
-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/MapNicEntityToNicCreationResponseDto.java18
-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/MapNicEntityToNicDto.java20
-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/MapNicRequestDtoToNicEntity.java26
-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/MapNicToNicDto.java26
-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/MapPackageInfoToPackageInfoDto.java34
-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/MapProcessEntityToProcessEntityDto.java25
-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/MapProcessRequestDtoToProcessEntity.java21
-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/MapQuestionnaireResponseToQuestionnaireResponseDto.java20
-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/MapQuestionnaireToQuestionnaireDto.java21
-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/MapUploadFileResponseToUploadFileResponseDto.java24
-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.java92
-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/MapVspDescriptionDtoToItem.java20
-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/MapVspDescriptionDtoToVspDetails.java47
-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/MapVspDetailsToDto.java51
44 files changed, 498 insertions, 586 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/MapComponentDataToComponentDto.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/MapComponentDataToComponentDto.java
index eae59cf103..ac6b3a887f 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/MapComponentDataToComponentDto.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/MapComponentDataToComponentDto.java
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
@@ -21,11 +20,11 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
public class MapComponentDataToComponentDto extends MappingBase<ComponentData, ComponentDto> {
- @Override
- public void doMapping(ComponentData source, ComponentDto target) {
- target.setName(source.getName());
- target.setDisplayName(
- source.getDisplayName() == null ? source.getName() : source.getDisplayName());
- target.setDescription(source.getDescription());
- }
+
+ @Override
+ public void doMapping(ComponentData source, ComponentDto target) {
+ target.setName(source.getName());
+ target.setDisplayName(source.getDisplayName() == null ? source.getName() : source.getDisplayName());
+ target.setDescription(source.getDescription());
+ }
}
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/MapComponentDependencyEntityToCreationDto.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/MapComponentDependencyEntityToCreationDto.java
index a82902bd84..e69d6a9380 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/MapComponentDependencyEntityToCreationDto.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/MapComponentDependencyEntityToCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyCreationDto;
-public class MapComponentDependencyEntityToCreationDto extends MappingBase
- <ComponentDependencyModelEntity, ComponentDependencyCreationDto> {
+public class MapComponentDependencyEntityToCreationDto extends MappingBase<ComponentDependencyModelEntity, ComponentDependencyCreationDto> {
- @Override
- public void doMapping(ComponentDependencyModelEntity source,
- ComponentDependencyCreationDto target) {
- target.setId(source.getId());
- }
+ @Override
+ public void doMapping(ComponentDependencyModelEntity source, ComponentDependencyCreationDto target) {
+ target.setId(source.getId());
+ }
}
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/MapComponentDependencyEntityToDto.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/MapComponentDependencyEntityToDto.java
index 1fdadcbc88..aedd06be69 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/MapComponentDependencyEntityToDto.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/MapComponentDependencyEntityToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,22 +17,19 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyResponseDto;
-public class MapComponentDependencyEntityToDto extends
- MappingBase<ComponentDependencyModelEntity, ComponentDependencyResponseDto> {
+public class MapComponentDependencyEntityToDto extends MappingBase<ComponentDependencyModelEntity, ComponentDependencyResponseDto> {
- @Override
- public void doMapping(ComponentDependencyModelEntity source,
- ComponentDependencyResponseDto target) {
- target.setSourceId(source.getSourceComponentId());
- target.setTargetId(source.getTargetComponentId());
- target.setRelationType(source.getRelation());
- target.setId(source.getId());
- }
+ @Override
+ public void doMapping(ComponentDependencyModelEntity source, ComponentDependencyResponseDto target) {
+ target.setSourceId(source.getSourceComponentId());
+ target.setTargetId(source.getTargetComponentId());
+ target.setRelationType(source.getRelation());
+ target.setId(source.getId());
+ }
}
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/MapComponentDependencyModelEntityToDto.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/MapComponentDependencyModelEntityToDto.java
index c4c54d4ed8..bcfe05da83 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/MapComponentDependencyModelEntityToDto.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/MapComponentDependencyModelEntityToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,21 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
-public class MapComponentDependencyModelEntityToDto extends
- MappingBase<ComponentDependencyModelEntity, ComponentDependencyModel> {
+public class MapComponentDependencyModelEntityToDto extends MappingBase<ComponentDependencyModelEntity, ComponentDependencyModel> {
- @Override
- public void doMapping(ComponentDependencyModelEntity source,
- ComponentDependencyModel target) {
- target.setSourceId(source.getSourceComponentId());
- target.setTargetId(source.getTargetComponentId());
- target.setRelationType(source.getRelation());
- }
+ @Override
+ public void doMapping(ComponentDependencyModelEntity source, ComponentDependencyModel target) {
+ target.setSourceId(source.getSourceComponentId());
+ target.setTargetId(source.getTargetComponentId());
+ target.setRelationType(source.getRelation());
+ }
}
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/MapComponentDependencyModelRequestToEntity.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/MapComponentDependencyModelRequestToEntity.java
index 4988ab43ab..73ef053455 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/MapComponentDependencyModelRequestToEntity.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/MapComponentDependencyModelRequestToEntity.java
@@ -12,11 +12,9 @@
* 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.
-*/
-
+ */
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.ErrorCode;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
@@ -25,21 +23,18 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRelationType;
-public class MapComponentDependencyModelRequestToEntity extends
- MappingBase<ComponentDependencyModel, ComponentDependencyModelEntity> {
+public class MapComponentDependencyModelRequestToEntity extends MappingBase<ComponentDependencyModel, ComponentDependencyModelEntity> {
- @Override
- public void doMapping(ComponentDependencyModel source,
- ComponentDependencyModelEntity target) {
- target.setSourceComponentId(source.getSourceId());
- target.setTargetComponentId(source.getTargetId());
- try {
- ComponentRelationType.valueOf(source.getRelationType());
- target.setRelation(source.getRelationType());
- } catch (IllegalArgumentException exception) {
- ErrorCode errorCode =
- ComponentDependencyModelErrorBuilder.getInvalidRelationTypeErrorBuilder();
- throw new CoreException(errorCode, exception);
+ @Override
+ public void doMapping(ComponentDependencyModel source, ComponentDependencyModelEntity target) {
+ target.setSourceComponentId(source.getSourceId());
+ target.setTargetComponentId(source.getTargetId());
+ try {
+ ComponentRelationType.valueOf(source.getRelationType());
+ target.setRelation(source.getRelationType());
+ } catch (IllegalArgumentException exception) {
+ ErrorCode errorCode = ComponentDependencyModelErrorBuilder.getInvalidRelationTypeErrorBuilder();
+ throw new CoreException(errorCode, exception);
+ }
}
- }
}
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/MapComponentEntityToComponentCreationDto.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/MapComponentEntityToComponentCreationDto.java
index f2f346891f..089a91694e 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/MapComponentEntityToComponentCreationDto.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/MapComponentEntityToComponentCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,17 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentCreationDto;
-public class MapComponentEntityToComponentCreationDto extends MappingBase<ComponentEntity,
- ComponentCreationDto> {
- @Override
- public void doMapping(ComponentEntity source, ComponentCreationDto target) {
- target.setVfcId(source.getId());
- }
+public class MapComponentEntityToComponentCreationDto extends MappingBase<ComponentEntity, ComponentCreationDto> {
+
+ @Override
+ public void doMapping(ComponentEntity source, ComponentCreationDto target) {
+ target.setVfcId(source.getId());
+ }
}
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/MapComponentEntityToComponentDto.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/MapComponentEntityToComponentDto.java
index 8878581d1c..e82363eae9 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/MapComponentEntityToComponentDto.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/MapComponentEntityToComponentDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
@@ -26,12 +25,13 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
public class MapComponentEntityToComponentDto extends MappingBase<ComponentEntity, ComponentDto> {
- @Override
- public void doMapping(ComponentEntity source, ComponentDto target) {
- target.setId(source.getId());
- ComponentData component = source.getComponentCompositionData();
- if (component != null) {
- new MapComponentDataToComponentDto().doMapping(component, target);
+
+ @Override
+ public void doMapping(ComponentEntity source, ComponentDto target) {
+ target.setId(source.getId());
+ ComponentData component = source.getComponentCompositionData();
+ if (component != null) {
+ new MapComponentDataToComponentDto().doMapping(component, target);
+ }
}
- }
}
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/MapComponentRequestDtoToComponentEntity.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/MapComponentRequestDtoToComponentEntity.java
index 53a4482820..a890d0d737 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/MapComponentRequestDtoToComponentEntity.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/MapComponentRequestDtoToComponentEntity.java
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
@@ -21,14 +20,14 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto;
-public class MapComponentRequestDtoToComponentEntity
- extends MappingBase<ComponentRequestDto, ComponentEntity> {
- @Override
- public void doMapping(ComponentRequestDto source, ComponentEntity target) {
- ComponentData component = new ComponentData();
- component.setName(source.getName());
- component.setDisplayName(source.getDisplayName());
- component.setDescription(source.getDescription());
- target.setComponentCompositionData(component);
- }
+public class MapComponentRequestDtoToComponentEntity extends MappingBase<ComponentRequestDto, ComponentEntity> {
+
+ @Override
+ public void doMapping(ComponentRequestDto source, ComponentEntity target) {
+ ComponentData component = new ComponentData();
+ component.setName(source.getName());
+ component.setDisplayName(source.getDisplayName());
+ component.setDescription(source.getDescription());
+ target.setComponentCompositionData(component);
+ }
}
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/MapCompositionEntityResponseToDto.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/MapCompositionEntityResponseToDto.java
index f7ecc243f1..743723771d 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/MapCompositionEntityResponseToDto.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/MapCompositionEntityResponseToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
@@ -26,22 +25,21 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionDataEntityDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
-public class MapCompositionEntityResponseToDto<S extends CompositionDataEntity, T extends
- CompositionDataEntityDto, M extends MappingBase<S, T>>
- extends MappingBase<CompositionEntityResponse<S>, CompositionEntityResponseDto<T>> {
- private M dataMapper;
- private Class<T> targetDataClass;
+public class MapCompositionEntityResponseToDto<S extends CompositionDataEntity, T extends CompositionDataEntityDto, M extends MappingBase<S, T>> extends
+ MappingBase<CompositionEntityResponse<S>, CompositionEntityResponseDto<T>> {
+
+ private M dataMapper;
+ private Class<T> targetDataClass;
- public MapCompositionEntityResponseToDto(M dataMapper, Class<T> targetDataClass) {
- this.dataMapper = dataMapper;
- this.targetDataClass = targetDataClass;
- }
+ public MapCompositionEntityResponseToDto(M dataMapper, Class<T> targetDataClass) {
+ this.dataMapper = dataMapper;
+ this.targetDataClass = targetDataClass;
+ }
- @Override
- public void doMapping(CompositionEntityResponse<S> source,
- CompositionEntityResponseDto<T> target) {
- target.setId(source.getId());
- target.setSchema(source.getSchema());
- target.setData(dataMapper.applyMapping(source.getData(), targetDataClass));
- }
+ @Override
+ public void doMapping(CompositionEntityResponse<S> source, CompositionEntityResponseDto<T> target) {
+ target.setId(source.getId());
+ target.setSchema(source.getSchema());
+ target.setData(dataMapper.applyMapping(source.getData(), targetDataClass));
+ }
}
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/MapCompositionEntityValidationDataToDto.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/MapCompositionEntityValidationDataToDto.java
index ee7a9f446e..00c5c2f266 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/MapCompositionEntityValidationDataToDto.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/MapCompositionEntityValidationDataToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,29 +17,26 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
+import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
-import java.util.stream.Collectors;
+public class MapCompositionEntityValidationDataToDto extends MappingBase<CompositionEntityValidationData, CompositionEntityValidationDataDto> {
-public class MapCompositionEntityValidationDataToDto
- extends MappingBase<CompositionEntityValidationData, CompositionEntityValidationDataDto> {
- @Override
- public void doMapping(CompositionEntityValidationData source,
- CompositionEntityValidationDataDto target) {
- target.setEntityType(source.getEntityType());
- target.setEntityId(source.getEntityId());
- target.setEntityName(source.getEntityName());
- target.setErrors(source.getErrors());
- if (CollectionUtils.isNotEmpty(source.getSubEntitiesValidationData())) {
- target.setSubEntitiesValidationData(source.getSubEntitiesValidationData().stream()
- .map(sub -> applyMapping(sub, CompositionEntityValidationDataDto.class))
- .collect(Collectors.toList()));
+ @Override
+ public void doMapping(CompositionEntityValidationData source, CompositionEntityValidationDataDto target) {
+ target.setEntityType(source.getEntityType());
+ target.setEntityId(source.getEntityId());
+ target.setEntityName(source.getEntityName());
+ target.setErrors(source.getErrors());
+ if (CollectionUtils.isNotEmpty(source.getSubEntitiesValidationData())) {
+ target.setSubEntitiesValidationData(
+ source.getSubEntitiesValidationData().stream().map(sub -> applyMapping(sub, CompositionEntityValidationDataDto.class))
+ .collect(Collectors.toList()));
+ }
}
- }
}
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/MapComputeDataToComputeDetailsDto.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/MapComputeDataToComputeDetailsDto.java
index 3bfecb93f5..a32f4fb076 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/MapComputeDataToComputeDetailsDto.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/MapComputeDataToComputeDetailsDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData;
@@ -26,10 +25,9 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDetailsDto;
public class MapComputeDataToComputeDetailsDto extends MappingBase<ComputeData, ComputeDetailsDto> {
- @Override
- public void doMapping(ComputeData source, ComputeDetailsDto target) {
-
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- }
+ @Override
+ public void doMapping(ComputeData source, ComputeDetailsDto target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ }
}
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/MapComputeDetailsDtoToComputeEntity.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/MapComputeDetailsDtoToComputeEntity.java
index 93db7e3e76..835f5dd05d 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/MapComputeDetailsDtoToComputeEntity.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/MapComputeDetailsDtoToComputeEntity.java
@@ -21,13 +21,11 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDescription;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDetailsDto;
-public class MapComputeDetailsDtoToComputeEntity extends MappingBase<ComputeDetailsDto,
- ComputeEntity> {
+public class MapComputeDetailsDtoToComputeEntity extends MappingBase<ComputeDetailsDto, ComputeEntity> {
- @Override
- public void doMapping(ComputeDetailsDto source, ComputeEntity target) {
- ComputeDescription computeDesc = new ComputeDescription(source.getName(), source
- .getDescription());
- target.setCompositionData(JsonUtil.object2Json(computeDesc));
- }
+ @Override
+ public void doMapping(ComputeDetailsDto source, ComputeEntity target) {
+ ComputeDescription computeDesc = new ComputeDescription(source.getName(), source.getDescription());
+ target.setCompositionData(JsonUtil.object2Json(computeDesc));
+ }
}
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/MapComputeEntityToComputeCreationDto.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/MapComputeEntityToComputeCreationDto.java
index 4e1599d058..531c28b48a 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/MapComputeEntityToComputeCreationDto.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/MapComputeEntityToComputeCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,17 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeCreationDto;
-public class MapComputeEntityToComputeCreationDto extends
- MappingBase<ComputeEntity, ComputeCreationDto> {
- @Override
- public void doMapping(ComputeEntity source, ComputeCreationDto target) {
- target.setId(source.getId());
- }
+public class MapComputeEntityToComputeCreationDto extends MappingBase<ComputeEntity, ComputeCreationDto> {
+
+ @Override
+ public void doMapping(ComputeEntity source, ComputeCreationDto target) {
+ target.setId(source.getId());
+ }
}
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/MapComputeEntityToComputeDto.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/MapComputeEntityToComputeDto.java
index cd67d2444b..a2cdceb060 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/MapComputeEntityToComputeDto.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/MapComputeEntityToComputeDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.core.utilities.json.JsonUtil;
@@ -27,15 +26,15 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDescription;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDto;
public class MapComputeEntityToComputeDto extends MappingBase<ListComputeResponse, ComputeDto> {
- @Override
- public void doMapping(ListComputeResponse source, ComputeDto target) {
- target.setId(source.getComputeEntity().getId());
- if (source.getComputeEntity().getCompositionData() != null) {
- ComputeDescription desc = JsonUtil.json2Object(source.getComputeEntity().getCompositionData
- (), ComputeDescription.class);
- target.setName(desc.getName());
- target.setDescription(desc.getDescription());
- target.setAssociatedToDeploymentFlavor(source.isAssociatedWithDeploymentFlavor());
+
+ @Override
+ public void doMapping(ListComputeResponse source, ComputeDto target) {
+ target.setId(source.getComputeEntity().getId());
+ if (source.getComputeEntity().getCompositionData() != null) {
+ ComputeDescription desc = JsonUtil.json2Object(source.getComputeEntity().getCompositionData(), ComputeDescription.class);
+ target.setName(desc.getName());
+ target.setDescription(desc.getDescription());
+ target.setAssociatedToDeploymentFlavor(source.isAssociatedWithDeploymentFlavor());
+ }
}
- }
}
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/MapComputeEntityToVspComputeDto.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/MapComputeEntityToVspComputeDto.java
index c75266f756..108d6438b5 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/MapComputeEntityToVspComputeDto.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/MapComputeEntityToVspComputeDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.core.utilities.json.JsonUtil;
@@ -27,14 +26,14 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDescription;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto;
public class MapComputeEntityToVspComputeDto extends MappingBase<ComputeEntity, VspComputeDto> {
- @Override
- public void doMapping(ComputeEntity source, VspComputeDto target) {
- target.setComputeFlavorId(source.getId());
- if (source.getCompositionData() != null) {
- ComputeDescription desc = JsonUtil.json2Object(source.getCompositionData(), ComputeDescription
- .class);
- target.setName(desc.getName());
- target.setComponentId(source.getComponentId());
+
+ @Override
+ public void doMapping(ComputeEntity source, VspComputeDto target) {
+ target.setComputeFlavorId(source.getId());
+ if (source.getCompositionData() != null) {
+ ComputeDescription desc = JsonUtil.json2Object(source.getCompositionData(), ComputeDescription.class);
+ target.setName(desc.getName());
+ target.setComponentId(source.getComponentId());
+ }
}
- }
}
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/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.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/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.java
index 42ff7c9058..292ee88ef9 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/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.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/MapDeploymentFlavorEntityDeploymentFlavorToListResponse.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
@@ -25,18 +24,15 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavo
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorListResponseDto;
-public class MapDeploymentFlavorEntityDeploymentFlavorToListResponse extends
- MappingBase<DeploymentFlavorEntity, DeploymentFlavorListResponseDto> {
-
- @Override
- public void doMapping(DeploymentFlavorEntity source,
- DeploymentFlavorListResponseDto target) {
- target.setId(source.getId());
- DeploymentFlavor deploymentFlavor = source.getDeploymentFlavorCompositionData();
+public class MapDeploymentFlavorEntityDeploymentFlavorToListResponse extends MappingBase<DeploymentFlavorEntity, DeploymentFlavorListResponseDto> {
- if (deploymentFlavor != null) {
- target.setModel(deploymentFlavor.getModel());
- target.setDescription(deploymentFlavor.getDescription());
+ @Override
+ public void doMapping(DeploymentFlavorEntity source, DeploymentFlavorListResponseDto target) {
+ target.setId(source.getId());
+ DeploymentFlavor deploymentFlavor = source.getDeploymentFlavorCompositionData();
+ if (deploymentFlavor != null) {
+ target.setModel(deploymentFlavor.getModel());
+ target.setDescription(deploymentFlavor.getDescription());
+ }
}
- }
}
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/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.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/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.java
index 05fa35d0ba..80b6649005 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/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.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/MapDeploymentFlavorEntityToDeploymentFlavorCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorCreationDto;
+public class MapDeploymentFlavorEntityToDeploymentFlavorCreationDto extends MappingBase<DeploymentFlavorEntity, DeploymentFlavorCreationDto> {
-public class MapDeploymentFlavorEntityToDeploymentFlavorCreationDto extends MappingBase<DeploymentFlavorEntity,
- DeploymentFlavorCreationDto> {
-
- @Override
- public void doMapping(DeploymentFlavorEntity source,
- DeploymentFlavorCreationDto target) {
- target.setDeploymentFlavorId(source.getId());
- }
+ @Override
+ public void doMapping(DeploymentFlavorEntity source, DeploymentFlavorCreationDto target) {
+ target.setDeploymentFlavorId(source.getId());
+ }
}
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/MapDeploymentFlavorEntityToDeploymentFlavorDto.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/MapDeploymentFlavorEntityToDeploymentFlavorDto.java
index 188ff82636..dbf9b2adf9 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/MapDeploymentFlavorEntityToDeploymentFlavorDto.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/MapDeploymentFlavorEntityToDeploymentFlavorDto.java
@@ -13,19 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto;
-public class MapDeploymentFlavorEntityToDeploymentFlavorDto extends
- MappingBase<DeploymentFlavorEntity, DeploymentFlavorDto> {
- @Override
- public void doMapping(DeploymentFlavorEntity source, DeploymentFlavorDto target) {
- target.setId(source.getId());
+public class MapDeploymentFlavorEntityToDeploymentFlavorDto extends MappingBase<DeploymentFlavorEntity, DeploymentFlavorDto> {
- }
+ @Override
+ public void doMapping(DeploymentFlavorEntity source, DeploymentFlavorDto target) {
+ target.setId(source.getId());
+ }
}
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/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.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/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.java
index 97ccf28def..6bd60b81a2 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/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.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/MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
@@ -25,16 +24,15 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavo
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorRequestDto;
-public class MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity
- extends MappingBase<DeploymentFlavorRequestDto, DeploymentFlavorEntity> {
+public class MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity extends MappingBase<DeploymentFlavorRequestDto, DeploymentFlavorEntity> {
- @Override
- public void doMapping(DeploymentFlavorRequestDto source, DeploymentFlavorEntity target) {
- DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
- deploymentFlavor.setModel(source.getModel());
- deploymentFlavor.setDescription(source.getDescription());
- deploymentFlavor.setFeatureGroupId(source.getFeatureGroupId());
- deploymentFlavor.setComponentComputeAssociations(source.getComponentComputeAssociations());
- target.setDeploymentFlavorCompositionData(deploymentFlavor);
- }
+ @Override
+ public void doMapping(DeploymentFlavorRequestDto source, DeploymentFlavorEntity target) {
+ DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
+ deploymentFlavor.setModel(source.getModel());
+ deploymentFlavor.setDescription(source.getDescription());
+ deploymentFlavor.setFeatureGroupId(source.getFeatureGroupId());
+ deploymentFlavor.setComponentComputeAssociations(source.getComponentComputeAssociations());
+ target.setDeploymentFlavorCompositionData(deploymentFlavor);
+ }
}
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/MapDeploymentFlavorToDeploymentDto.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/MapDeploymentFlavorToDeploymentDto.java
index 06d299c805..b26669e511 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/MapDeploymentFlavorToDeploymentDto.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/MapDeploymentFlavorToDeploymentDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,19 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto;
-
public class MapDeploymentFlavorToDeploymentDto extends MappingBase<DeploymentFlavor, DeploymentFlavorDto> {
- @Override
- public void doMapping(DeploymentFlavor source, DeploymentFlavorDto target) {
- target.setModel(source.getModel());
- target.setDescription(source.getDescription());
- target.setFeatureGroupId(source.getFeatureGroupId());
- target.setComponentComputeAssociations(source.getComponentComputeAssociations());
- }
+
+ @Override
+ public void doMapping(DeploymentFlavor source, DeploymentFlavorDto target) {
+ target.setModel(source.getModel());
+ target.setDescription(source.getDescription());
+ target.setFeatureGroupId(source.getFeatureGroupId());
+ target.setComponentComputeAssociations(source.getComponentComputeAssociations());
+ }
}
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/MapFilesDataStructureToDto.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/MapFilesDataStructureToDto.java
index c8734ff8ee..a769a4ed1b 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/MapFilesDataStructureToDto.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/MapFilesDataStructureToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,21 +17,19 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
-public class MapFilesDataStructureToDto
- extends MappingBase<FilesDataStructure, FileDataStructureDto> {
+public class MapFilesDataStructureToDto extends MappingBase<FilesDataStructure, FileDataStructureDto> {
- @Override
- public void doMapping(FilesDataStructure source, FileDataStructureDto target) {
- target.setModules(source.getModules());
- target.setArtifacts(source.getArtifacts());
- target.setNested(source.getNested());
- target.setUnassigned(source.getUnassigned());
- }
+ @Override
+ public void doMapping(FilesDataStructure source, FileDataStructureDto target) {
+ target.setModules(source.getModules());
+ target.setArtifacts(source.getArtifacts());
+ target.setNested(source.getNested());
+ target.setUnassigned(source.getUnassigned());
+ }
}
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/MapImageDataToImageDto.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/MapImageDataToImageDto.java
index 4df6eb3de9..005de5fe9c 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/MapImageDataToImageDto.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/MapImageDataToImageDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,25 +17,17 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ImageData;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto;
-
public class MapImageDataToImageDto extends MappingBase<ImageData, ImageDto> {
- @Override
- public void doMapping(ImageData source, ImageDto target) {
- target.setFileName(source.getFileName());
- target.setDescription(source.getDescription());
- }
+ @Override
+ public void doMapping(ImageData source, ImageDto target) {
+ target.setFileName(source.getFileName());
+ target.setDescription(source.getDescription());
+ }
}
-
-
-
-
-
-
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/MapImageEntityToImageCreationDto.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/MapImageEntityToImageCreationDto.java
index cc15ef0898..5a811b2228 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/MapImageEntityToImageCreationDto.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/MapImageEntityToImageCreationDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,18 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageCreationDto;
-public class MapImageEntityToImageCreationDto extends MappingBase<ImageEntity,
- ImageCreationDto> {
+public class MapImageEntityToImageCreationDto extends MappingBase<ImageEntity, ImageCreationDto> {
- @Override
- public void doMapping(ImageEntity source, ImageCreationDto target) {
- target.setId(source.getId());
- }
+ @Override
+ public void doMapping(ImageEntity source, ImageCreationDto target) {
+ target.setId(source.getId());
+ }
}
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/MapImageEntityToImageDto.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/MapImageEntityToImageDto.java
index b35a0f2a38..d17735483f 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/MapImageEntityToImageDto.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/MapImageEntityToImageDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
@@ -27,14 +26,14 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto;
public class MapImageEntityToImageDto extends MappingBase<ImageEntity, ImageDto> {
- @Override
- public void doMapping(ImageEntity source, ImageDto target) {
- target.setId(source.getId());
- Image image = source.getImageCompositionData();
- if (image != null) {
- ImageData imageData = new ImageData(image.getFileName(), image.getDescription());
- new MapImageDataToImageDto().doMapping(imageData, target);
+ @Override
+ public void doMapping(ImageEntity source, ImageDto target) {
+ target.setId(source.getId());
+ Image image = source.getImageCompositionData();
+ if (image != null) {
+ ImageData imageData = new ImageData(image.getFileName(), image.getDescription());
+ new MapImageDataToImageDto().doMapping(imageData, target);
+ }
}
- }
}
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/MapImageRequestDtoToImageEntity.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/MapImageRequestDtoToImageEntity.java
index 3e1c126226..fa2f432e89 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/MapImageRequestDtoToImageEntity.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/MapImageRequestDtoToImageEntity.java
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
@@ -23,12 +22,11 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageRequestDto;
public class MapImageRequestDtoToImageEntity extends MappingBase<ImageRequestDto, ImageEntity> {
- @Override
- public void doMapping(ImageRequestDto source, ImageEntity target) {
- Image image = new Image();
- image.setFileName(source.getFileName());
- image.setDescription(source.getDescription());
- target.setImageCompositionData(image);
- }
-
+ @Override
+ public void doMapping(ImageRequestDto source, ImageEntity target) {
+ Image image = new Image();
+ image.setFileName(source.getFileName());
+ image.setDescription(source.getDescription());
+ target.setImageCompositionData(image);
+ }
}
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/MapItemToVspDetailsDto.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/MapItemToVspDetailsDto.java
index 926f1f0b25..e0966e8350 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/MapItemToVspDetailsDto.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/MapItemToVspDetailsDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.versioning.types.Item;
@@ -26,15 +25,16 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
import org.openecomp.sdcrests.vsp.rest.services.VspItemProperty;
public class MapItemToVspDetailsDto extends MappingBase<Item, VspDetailsDto> {
- @Override
- public void doMapping(Item source, VspDetailsDto target) {
- target.setId(source.getId());
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setVendorId((String) source.getProperties().get(VspItemProperty.VENDOR_ID));
- target.setVendorName((String) source.getProperties().get(VspItemProperty.VENDOR_NAME));
- target.setOnboardingMethod((String) source.getProperties().get(VspItemProperty.ONBOARDING_METHOD));
- target.setOwner(source.getOwner());
- target.setStatus(source.getStatus().name());
- }
+
+ @Override
+ public void doMapping(Item source, VspDetailsDto target) {
+ target.setId(source.getId());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setVendorId((String) source.getProperties().get(VspItemProperty.VENDOR_ID));
+ target.setVendorName((String) source.getProperties().get(VspItemProperty.VENDOR_NAME));
+ target.setOnboardingMethod((String) source.getProperties().get(VspItemProperty.ONBOARDING_METHOD));
+ target.setOwner(source.getOwner());
+ target.setStatus(source.getStatus().name());
+ }
}
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/MapMonitoringUploadStatusToDto.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/MapMonitoringUploadStatusToDto.java
index 08d322dad0..08add59679 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/MapMonitoringUploadStatusToDto.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/MapMonitoringUploadStatusToDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,19 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MonitoringUploadStatus;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.MonitoringUploadStatusDto;
-public class MapMonitoringUploadStatusToDto
- extends MappingBase<MonitoringUploadStatus, MonitoringUploadStatusDto> {
- @Override
- public void doMapping(MonitoringUploadStatus source, MonitoringUploadStatusDto target) {
- target.setSnmpPoll(source.getSnmpPoll());
- target.setSnmpTrap(source.getSnmpTrap());
- target.setVesEvent(source.getVesEvent());
- }
+public class MapMonitoringUploadStatusToDto extends MappingBase<MonitoringUploadStatus, MonitoringUploadStatusDto> {
+
+ @Override
+ public void doMapping(MonitoringUploadStatus source, MonitoringUploadStatusDto target) {
+ target.setSnmpPoll(source.getSnmpPoll());
+ target.setSnmpTrap(source.getSnmpTrap());
+ target.setVesEvent(source.getVesEvent());
+ }
}
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/MapNetworkEntityToNetworkDto.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/MapNetworkEntityToNetworkDto.java
index 1d79f35769..cf2ced753e 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/MapNetworkEntityToNetworkDto.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/MapNetworkEntityToNetworkDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
@@ -26,12 +25,13 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
public class MapNetworkEntityToNetworkDto extends MappingBase<NetworkEntity, NetworkDto> {
- @Override
- public void doMapping(NetworkEntity source, NetworkDto target) {
- target.setId(source.getId());
- Network network = source.getNetworkCompositionData();
- if (network != null) {
- new MapNetworkToNetworkDto().doMapping(network, target);
+
+ @Override
+ public void doMapping(NetworkEntity source, NetworkDto target) {
+ target.setId(source.getId());
+ Network network = source.getNetworkCompositionData();
+ if (network != null) {
+ new MapNetworkToNetworkDto().doMapping(network, target);
+ }
}
- }
}
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/MapNetworkRequestDtoToNetworkEntity.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/MapNetworkRequestDtoToNetworkEntity.java
index 00395c4b99..4db9209c53 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/MapNetworkRequestDtoToNetworkEntity.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/MapNetworkRequestDtoToNetworkEntity.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
@@ -25,13 +24,13 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto;
-public class MapNetworkRequestDtoToNetworkEntity
- extends MappingBase<NetworkRequestDto, NetworkEntity> {
- @Override
- public void doMapping(NetworkRequestDto source, NetworkEntity target) {
- Network network = new Network();
- network.setName(source.getName());
- network.setDhcp(source.isDhcp());
- target.setNetworkCompositionData(network);
- }
+public class MapNetworkRequestDtoToNetworkEntity extends MappingBase<NetworkRequestDto, NetworkEntity> {
+
+ @Override
+ public void doMapping(NetworkRequestDto source, NetworkEntity target) {
+ Network network = new Network();
+ network.setName(source.getName());
+ network.setDhcp(source.isDhcp());
+ target.setNetworkCompositionData(network);
+ }
}
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/MapNetworkToNetworkDto.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/MapNetworkToNetworkDto.java
index dd819de1a6..6cede067f1 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/MapNetworkToNetworkDto.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/MapNetworkToNetworkDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
@@ -25,9 +24,10 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
public class MapNetworkToNetworkDto extends MappingBase<Network, NetworkDto> {
- @Override
- public void doMapping(Network source, NetworkDto target) {
- target.setName(source.getName());
- target.setDhcp(source.isDhcp());
- }
+
+ @Override
+ public void doMapping(Network source, NetworkDto target) {
+ target.setName(source.getName());
+ target.setDhcp(source.isDhcp());
+ }
}
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/MapNicEntityToNicCreationResponseDto.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/MapNicEntityToNicCreationResponseDto.java
index 835ff0b7b9..a3be49e684 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/MapNicEntityToNicCreationResponseDto.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/MapNicEntityToNicCreationResponseDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,16 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicCreationResponseDto;
-public class MapNicEntityToNicCreationResponseDto extends MappingBase<NicEntity,
- NicCreationResponseDto> {
-
+public class MapNicEntityToNicCreationResponseDto extends MappingBase<NicEntity, NicCreationResponseDto> {
- @Override
- public void doMapping(NicEntity source, NicCreationResponseDto target) {
- target.setNicId(source.getId());
- }
+ @Override
+ public void doMapping(NicEntity source, NicCreationResponseDto target) {
+ target.setNicId(source.getId());
+ }
}
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/MapNicEntityToNicDto.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/MapNicEntityToNicDto.java
index 2af7e2ff6b..ea56e73237 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/MapNicEntityToNicDto.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/MapNicEntityToNicDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
@@ -26,12 +25,13 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
public class MapNicEntityToNicDto extends MappingBase<NicEntity, NicDto> {
- @Override
- public void doMapping(NicEntity source, NicDto target) {
- target.setId(source.getId());
- Nic nic = source.getNicCompositionData();
- if (nic != null) {
- new MapNicToNicDto().doMapping(nic, target);
+
+ @Override
+ public void doMapping(NicEntity source, NicDto target) {
+ target.setId(source.getId());
+ Nic nic = source.getNicCompositionData();
+ if (nic != null) {
+ new MapNicToNicDto().doMapping(nic, target);
+ }
}
- }
}
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/MapNicRequestDtoToNicEntity.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/MapNicRequestDtoToNicEntity.java
index 7fd0253556..da2d7c8814 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/MapNicRequestDtoToNicEntity.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/MapNicRequestDtoToNicEntity.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
@@ -27,14 +26,15 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto;
public class MapNicRequestDtoToNicEntity extends MappingBase<NicRequestDto, NicEntity> {
- @Override
- public void doMapping(NicRequestDto source, NicEntity target) {
- Nic nic = new Nic();
- nic.setName(source.getName());
- nic.setDescription(source.getDescription());
- nic.setNetworkId(source.getNetworkId());
- nic.setNetworkType(NetworkType.valueOf(source.getNetworkType()));
- nic.setNetworkDescription(source.getNetworkDescription());
- target.setNicCompositionData(nic);
- }
+
+ @Override
+ public void doMapping(NicRequestDto source, NicEntity target) {
+ Nic nic = new Nic();
+ nic.setName(source.getName());
+ nic.setDescription(source.getDescription());
+ nic.setNetworkId(source.getNetworkId());
+ nic.setNetworkType(NetworkType.valueOf(source.getNetworkType()));
+ nic.setNetworkDescription(source.getNetworkDescription());
+ target.setNicCompositionData(nic);
+ }
}
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/MapNicToNicDto.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/MapNicToNicDto.java
index 8c48f18b3d..4a22fb5f19 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/MapNicToNicDto.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/MapNicToNicDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
@@ -25,15 +24,16 @@ import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
public class MapNicToNicDto extends MappingBase<Nic, NicDto> {
- @Override
- public void doMapping(Nic source, NicDto target) {
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setNetworkId(source.getNetworkId());
- target.setNetworkName(source.getNetworkName());
- if (source.getNetworkType() != null) {
- target.setNetworkType(source.getNetworkType().name());
+
+ @Override
+ public void doMapping(Nic source, NicDto target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setNetworkId(source.getNetworkId());
+ target.setNetworkName(source.getNetworkName());
+ if (source.getNetworkType() != null) {
+ target.setNetworkType(source.getNetworkType().name());
+ }
+ target.setNetworkDescription(source.getNetworkDescription());
}
- target.setNetworkDescription(source.getNetworkDescription());
- }
}
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/MapPackageInfoToPackageInfoDto.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/MapPackageInfoToPackageInfoDto.java
index 1bf13f8c3f..c6faa0361b 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/MapPackageInfoToPackageInfoDto.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/MapPackageInfoToPackageInfoDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
@@ -28,18 +27,19 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto;
* Created by TALIO on 4/25/2016.
*/
public class MapPackageInfoToPackageInfoDto extends MappingBase<PackageInfo, PackageInfoDto> {
- @Override
- public void doMapping(PackageInfo source, PackageInfoDto target) {
- target.setVspName(source.getVspName());
- target.setPackageId(source.getVspId());
- target.setDescription(source.getVspDescription());
- target.setVersion(source.getVersion());
- target.setPackageType(source.getPackageType());
- target.setCategory(source.getCategory());
- target.setSubCategory(source.getSubCategory());
- target.setPackageChecksum(source.getPackageChecksum());
- target.setVendorRelease(source.getVendorRelease());
- target.setVendorName(source.getVendorName());
- target.setResourceType(source.getResourceType());
- }
+
+ @Override
+ public void doMapping(PackageInfo source, PackageInfoDto target) {
+ target.setVspName(source.getVspName());
+ target.setPackageId(source.getVspId());
+ target.setDescription(source.getVspDescription());
+ target.setVersion(source.getVersion());
+ target.setPackageType(source.getPackageType());
+ target.setCategory(source.getCategory());
+ target.setSubCategory(source.getSubCategory());
+ target.setPackageChecksum(source.getPackageChecksum());
+ target.setVendorRelease(source.getVendorRelease());
+ target.setVendorName(source.getVendorName());
+ target.setResourceType(source.getResourceType());
+ }
}
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/MapProcessEntityToProcessEntityDto.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/MapProcessEntityToProcessEntityDto.java
index 96a67a9d87..6d6a6d29de 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/MapProcessEntityToProcessEntityDto.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/MapProcessEntityToProcessEntityDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,21 +17,20 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
-public class MapProcessEntityToProcessEntityDto
- extends MappingBase<ProcessEntity, ProcessEntityDto> {
- @Override
- public void doMapping(ProcessEntity source, ProcessEntityDto target) {
- target.setId(source.getId());
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setType(source.getType());
- target.setArtifactName(source.getArtifactName());
- }
+public class MapProcessEntityToProcessEntityDto extends MappingBase<ProcessEntity, ProcessEntityDto> {
+
+ @Override
+ public void doMapping(ProcessEntity source, ProcessEntityDto target) {
+ target.setId(source.getId());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setType(source.getType());
+ target.setArtifactName(source.getArtifactName());
+ }
}
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/MapProcessRequestDtoToProcessEntity.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/MapProcessRequestDtoToProcessEntity.java
index d1a28d7145..2f53b24d25 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/MapProcessRequestDtoToProcessEntity.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/MapProcessRequestDtoToProcessEntity.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,19 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
-public class MapProcessRequestDtoToProcessEntity
- extends MappingBase<ProcessRequestDto, ProcessEntity> {
- @Override
- public void doMapping(ProcessRequestDto source, ProcessEntity target) {
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setType(source.getType());
- }
+public class MapProcessRequestDtoToProcessEntity extends MappingBase<ProcessRequestDto, ProcessEntity> {
+
+ @Override
+ public void doMapping(ProcessRequestDto source, ProcessEntity target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setType(source.getType());
+ }
}
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/MapQuestionnaireResponseToQuestionnaireResponseDto.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/MapQuestionnaireResponseToQuestionnaireResponseDto.java
index 52252c0425..598596b030 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/MapQuestionnaireResponseToQuestionnaireResponseDto.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/MapQuestionnaireResponseToQuestionnaireResponseDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,20 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
-public class MapQuestionnaireResponseToQuestionnaireResponseDto
- extends MappingBase<QuestionnaireResponse, QuestionnaireResponseDto> {
+public class MapQuestionnaireResponseToQuestionnaireResponseDto extends MappingBase<QuestionnaireResponse, QuestionnaireResponseDto> {
- @Override
- public void doMapping(QuestionnaireResponse source, QuestionnaireResponseDto target) {
- target.setData(source.getData());
- target.setSchema(source.getSchema());
- target.setErrorMessage(source.getErrorMessage());
- }
+ @Override
+ public void doMapping(QuestionnaireResponse source, QuestionnaireResponseDto target) {
+ target.setData(source.getData());
+ target.setSchema(source.getSchema());
+ target.setErrorMessage(source.getErrorMessage());
+ }
}
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/MapQuestionnaireToQuestionnaireDto.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/MapQuestionnaireToQuestionnaireDto.java
index fe8e3c5ea4..e846f0e047 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/MapQuestionnaireToQuestionnaireDto.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/MapQuestionnaireToQuestionnaireDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,25 +17,22 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
+import java.util.HashMap;
import org.openecomp.core.utilities.json.JsonUtil;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireDto;
-import java.util.HashMap;
-
/**
* Created by ayalaben on 9/26/2017
*/
-public class MapQuestionnaireToQuestionnaireDto extends
- MappingBase<CompositionEntity, QuestionnaireDto> {
+public class MapQuestionnaireToQuestionnaireDto extends MappingBase<CompositionEntity, QuestionnaireDto> {
- @Override
- public void doMapping(CompositionEntity source, QuestionnaireDto target) {
- target.setId(source.getId());
- target.setQuestionareData(JsonUtil.json2Object(source.getQuestionnaireData(), HashMap.class));
- }
+ @Override
+ public void doMapping(CompositionEntity source, QuestionnaireDto target) {
+ target.setId(source.getId());
+ target.setQuestionareData(JsonUtil.json2Object(source.getQuestionnaireData(), HashMap.class));
+ }
}
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/MapUploadFileResponseToUploadFileResponseDto.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/MapUploadFileResponseToUploadFileResponseDto.java
index 48053d053d..f78e2e0dee 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/MapUploadFileResponseToUploadFileResponseDto.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/MapUploadFileResponseToUploadFileResponseDto.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,10 +17,8 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
-
import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
import org.openecomp.sdcrests.mapping.MappingBase;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
@@ -28,13 +26,13 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto
/**
* Created by TALIO on 4/27/2016.
*/
-public class MapUploadFileResponseToUploadFileResponseDto
- extends MappingBase<UploadFileResponse, UploadFileResponseDto> {
- @Override
- public void doMapping(UploadFileResponse source, UploadFileResponseDto target) {
- target.setStatus(source.getStatus());
- target.setErrors(source.getErrors());
- target.setOnboardingOrigin(source.getOnboardingType().toString());
- target.setNetworkPackageName(source.getNetworkPackageName());
- }
+public class MapUploadFileResponseToUploadFileResponseDto extends MappingBase<UploadFileResponse, UploadFileResponseDto> {
+
+ @Override
+ public void doMapping(UploadFileResponse source, UploadFileResponseDto target) {
+ target.setStatus(source.getStatus());
+ target.setErrors(source.getErrors());
+ target.setOnboardingOrigin(source.getOnboardingType().toString());
+ target.setNetworkPackageName(source.getNetworkPackageName());
+ }
}
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 b3fbe1e7c9..8048786f69 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
@@ -13,9 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.openecomp.sdc.common.errors.ErrorCode;
@@ -32,61 +38,47 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityVali
import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireValidationResultDto;
import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto;
-import java.util.*;
-import java.util.stream.Collectors;
+public class MapValidationResponseToDto extends MappingBase<ValidationResponse, ValidationResponseDto> {
-public class MapValidationResponseToDto
- extends MappingBase<ValidationResponse, ValidationResponseDto> {
- private static Map<String, List<ErrorMessageDto>> mapUploadDataErrors(
- Map<String, List<ErrorMessage>> uploadDataErrors) {
- if (MapUtils.isEmpty(uploadDataErrors)) {
- return null;
+ private static Map<String, List<ErrorMessageDto>> mapUploadDataErrors(Map<String, List<ErrorMessage>> uploadDataErrors) {
+ if (MapUtils.isEmpty(uploadDataErrors)) {
+ return null;
+ }
+ return uploadDataErrors.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> mapErrorMessages(entry.getValue())));
}
- return uploadDataErrors.entrySet().stream().collect(
- Collectors.toMap(Map.Entry::getKey, entry -> mapErrorMessages(entry.getValue())));
- }
- private static QuestionnaireValidationResultDto mapQuestionnaireValidationResult(
- QuestionnaireValidationResult questionnaireValidationResult) {
- if (Objects.isNull(questionnaireValidationResult)
- || Objects.isNull(questionnaireValidationResult.getValidationData())) {
- return null;
+ private static QuestionnaireValidationResultDto mapQuestionnaireValidationResult(QuestionnaireValidationResult questionnaireValidationResult) {
+ if (Objects.isNull(questionnaireValidationResult) || Objects.isNull(questionnaireValidationResult.getValidationData())) {
+ return null;
+ }
+ QuestionnaireValidationResultDto questionnaireValidationResultDto = new QuestionnaireValidationResultDto();
+ questionnaireValidationResultDto.setValid(questionnaireValidationResult.isValid());
+ Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
+ for (CompositionEntityValidationData validationData : questionnaireValidationResult.getValidationData()) {
+ validationDataDto
+ .add(new MapCompositionEntityValidationDataToDto().applyMapping(validationData, CompositionEntityValidationDataDto.class));
+ }
+ questionnaireValidationResultDto.setValidationData(validationDataDto);
+ return questionnaireValidationResultDto;
}
- QuestionnaireValidationResultDto questionnaireValidationResultDto =
- new QuestionnaireValidationResultDto();
- questionnaireValidationResultDto.setValid(questionnaireValidationResult.isValid());
- Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
- for (CompositionEntityValidationData validationData : questionnaireValidationResult
- .getValidationData()) {
- validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping(
- validationData, CompositionEntityValidationDataDto.class));
+ private static List<ErrorMessageDto> mapErrorMessages(List<ErrorMessage> errorMessages) {
+ return errorMessages == null ? null
+ : errorMessages.stream().map(errorMessage -> new MapErrorMessageToDto().applyMapping(errorMessage, ErrorMessageDto.class))
+ .collect(Collectors.toList());
}
- questionnaireValidationResultDto.setValidationData(validationDataDto);
- return questionnaireValidationResultDto;
- }
-
-
- private static List<ErrorMessageDto> mapErrorMessages(List<ErrorMessage> errorMessages) {
- return errorMessages == null ? null : errorMessages.stream().map(
- errorMessage -> new MapErrorMessageToDto()
- .applyMapping(errorMessage, ErrorMessageDto.class)).collect(Collectors.toList());
- }
-
- private static Collection<ErrorCodeDto> mapErrorCodes(Collection<ErrorCode> errorCodes) {
- return CollectionUtils.isEmpty(errorCodes) ? null : errorCodes.stream()
- .map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class))
- .collect(Collectors.toList());
- }
+ private static Collection<ErrorCodeDto> mapErrorCodes(Collection<ErrorCode> errorCodes) {
+ return CollectionUtils.isEmpty(errorCodes) ? null
+ : errorCodes.stream().map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class)).collect(Collectors.toList());
+ }
- @Override
- public void doMapping(ValidationResponse source, ValidationResponseDto target) {
- target.setValid(source.isValid());
- target.setVspErrors(mapErrorCodes(source.getVspErrors()));
- target.setLicensingDataErrors(mapErrorCodes(source.getLicensingDataErrors()));
- target.setUploadDataErrors(mapUploadDataErrors(source.getUploadDataErrors()));
- target.setQuestionnaireValidationResult(
- mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult()));
- }
+ @Override
+ public void doMapping(ValidationResponse source, ValidationResponseDto target) {
+ target.setValid(source.isValid());
+ target.setVspErrors(mapErrorCodes(source.getVspErrors()));
+ target.setLicensingDataErrors(mapErrorCodes(source.getLicensingDataErrors()));
+ target.setUploadDataErrors(mapUploadDataErrors(source.getUploadDataErrors()));
+ target.setQuestionnaireValidationResult(mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult()));
+ }
}
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/MapVspDescriptionDtoToItem.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/MapVspDescriptionDtoToItem.java
index 484b7c80bb..0543c20298 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/MapVspDescriptionDtoToItem.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/MapVspDescriptionDtoToItem.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.versioning.types.Item;
@@ -26,11 +25,12 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
import org.openecomp.sdcrests.vsp.rest.services.VspItemProperty;
public class MapVspDescriptionDtoToItem extends MappingBase<VspDescriptionDto, Item> {
- @Override
- public void doMapping(VspDescriptionDto source, Item target) {
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.addProperty(VspItemProperty.VENDOR_ID, source.getVendorId());
- target.addProperty(VspItemProperty.VENDOR_NAME, source.getVendorName());
- }
+
+ @Override
+ public void doMapping(VspDescriptionDto source, Item target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.addProperty(VspItemProperty.VENDOR_ID, source.getVendorId());
+ target.addProperty(VspItemProperty.VENDOR_NAME, source.getVendorName());
+ }
}
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/MapVspDescriptionDtoToVspDetails.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/MapVspDescriptionDtoToVspDetails.java
index 3ab2667821..4c9c16df89 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/MapVspDescriptionDtoToVspDetails.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/MapVspDescriptionDtoToVspDetails.java
@@ -7,9 +7,9 @@
* 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.LicenseType;
@@ -29,27 +28,25 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
public class MapVspDescriptionDtoToVspDetails extends MappingBase<VspDescriptionDto, VspDetails> {
- @Override
- public void doMapping(VspDescriptionDto source, VspDetails target) {
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setCategory(source.getCategory());
- target.setSubCategory(source.getSubCategory());
- target.setIcon(source.getIcon());
- target.setVendorName(source.getVendorName());
- target.setVendorId(source.getVendorId());
-
- if (source.getLicensingVersion() != null && source.getLicenseType() != LicenseType.EXTERNAL) {
- target.setVlmVersion(new Version(source.getLicensingVersion()));
- }
- if (source.getLicenseType() != null) {
- target.setLicenseType(source.getLicenseType().name());
- }
-
- LicensingData licensingData = source.getLicensingData();
- if (licensingData != null && source.getLicenseType() != LicenseType.EXTERNAL) {
- target.setLicenseAgreement(licensingData.getLicenseAgreement());
- target.setFeatureGroups(licensingData.getFeatureGroups());
+ @Override
+ public void doMapping(VspDescriptionDto source, VspDetails target) {
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setCategory(source.getCategory());
+ target.setSubCategory(source.getSubCategory());
+ target.setIcon(source.getIcon());
+ target.setVendorName(source.getVendorName());
+ target.setVendorId(source.getVendorId());
+ if (source.getLicensingVersion() != null && source.getLicenseType() != LicenseType.EXTERNAL) {
+ target.setVlmVersion(new Version(source.getLicensingVersion()));
+ }
+ if (source.getLicenseType() != null) {
+ target.setLicenseType(source.getLicenseType().name());
+ }
+ LicensingData licensingData = source.getLicensingData();
+ if (licensingData != null && source.getLicenseType() != LicenseType.EXTERNAL) {
+ target.setLicenseAgreement(licensingData.getLicenseAgreement());
+ target.setFeatureGroups(licensingData.getFeatureGroups());
+ }
}
- }
}
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/MapVspDetailsToDto.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/MapVspDetailsToDto.java
index 1ba5d1355c..1605ab7218 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/MapVspDetailsToDto.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/MapVspDetailsToDto.java
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdcrests.vsp.rest.mapping;
import org.apache.commons.lang3.StringUtils;
@@ -29,31 +28,29 @@ import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
public class MapVspDetailsToDto extends MappingBase<VspDetails, VspDetailsDto> {
- @Override
- public void doMapping(VspDetails source, VspDetailsDto target) {
- target.setId(source.getId());
- target.setVersion(source.getVersion() == null ? null : source.getVersion().getId());
- target.setName(source.getName());
- target.setDescription(source.getDescription());
- target.setIcon(source.getIcon());
- target.setCategory(source.getCategory());
- target.setSubCategory(source.getSubCategory());
- target.setVendorId(source.getVendorId());
- target.setVendorName(source.getVendorName());
- target.setLicensingVersion(
- source.getVlmVersion() == null ? null : source.getVlmVersion().getId());
- if (StringUtils.isNotBlank(source.getLicenseType())) {
- target.setLicenseType(LicenseType.valueOf(source.getLicenseType()));
- } else if (StringUtils.isNotBlank(target.getLicensingVersion())){
- target.setLicenseType(LicenseType.INTERNAL);
- }
- if (source.getLicenseAgreement() != null || source.getFeatureGroups() != null) {
- LicensingData licensingData = new LicensingData();
- licensingData.setLicenseAgreement(source.getLicenseAgreement());
- licensingData.setFeatureGroups(source.getFeatureGroups());
- target.setLicensingData(licensingData);
+ @Override
+ public void doMapping(VspDetails source, VspDetailsDto target) {
+ target.setId(source.getId());
+ target.setVersion(source.getVersion() == null ? null : source.getVersion().getId());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setIcon(source.getIcon());
+ target.setCategory(source.getCategory());
+ target.setSubCategory(source.getSubCategory());
+ target.setVendorId(source.getVendorId());
+ target.setVendorName(source.getVendorName());
+ target.setLicensingVersion(source.getVlmVersion() == null ? null : source.getVlmVersion().getId());
+ if (StringUtils.isNotBlank(source.getLicenseType())) {
+ target.setLicenseType(LicenseType.valueOf(source.getLicenseType()));
+ } else if (StringUtils.isNotBlank(target.getLicensingVersion())) {
+ target.setLicenseType(LicenseType.INTERNAL);
+ }
+ if (source.getLicenseAgreement() != null || source.getFeatureGroups() != null) {
+ LicensingData licensingData = new LicensingData();
+ licensingData.setLicenseAgreement(source.getLicenseAgreement());
+ licensingData.setFeatureGroups(source.getFeatureGroups());
+ target.setLicensingData(licensingData);
+ }
+ target.setOnboardingMethod(source.getOnboardingMethod());
}
-
- target.setOnboardingMethod(source.getOnboardingMethod());
- }
}