X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-ncmp-rest%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fcps%2Fncmp%2Frest%2Fcontroller%2FNcmpRestInputMapper.java;h=af785d56589a1c9159e41484876b14579adf748b;hb=624f04c03146e002bab2ca88e55b7f586c6e1aff;hp=4c8fafea5f35eec491242877211fbb6df0a47a4b;hpb=d5bda8848a661465f214b0bf11211e63b272cfd6;p=cps.git diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapper.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapper.java index 4c8fafea5..af785d565 100644 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapper.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapper.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation + * Copyright (C) 2022-2023 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,15 +20,20 @@ package org.onap.cps.ncmp.rest.controller; +import org.mapstruct.InheritConfiguration; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.NullValueCheckStrategy; import org.mapstruct.NullValuePropertyMappingStrategy; +import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters; import org.onap.cps.ncmp.api.models.DmiPluginRegistration; import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle; +import org.onap.cps.ncmp.rest.model.CmHandleQueryParameters; import org.onap.cps.ncmp.rest.model.RestDmiPluginRegistration; import org.onap.cps.ncmp.rest.model.RestInputCmHandle; +import org.onap.cps.ncmp.rest.model.RestModuleDefinition; import org.onap.cps.ncmp.rest.model.RestModuleReference; +import org.onap.cps.spi.model.ModuleDefinition; import org.onap.cps.spi.model.ModuleReference; @Mapper(componentModel = "spring") @@ -43,13 +48,26 @@ public interface NcmpRestInputMapper { @Mapping(source = "removedCmHandles", target = "removedCmHandles", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.SET_TO_DEFAULT) + @Mapping(source = "upgradedCmHandles", target = "upgradedCmHandles", + nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, + nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.SET_TO_DEFAULT) DmiPluginRegistration toDmiPluginRegistration(final RestDmiPluginRegistration restDmiPluginRegistration); - @Mapping(source = "cmHandle", target = "cmHandleID") + @Mapping(source = "cmHandle", target = "cmHandleId") @Mapping(source = "cmHandleProperties", target = "dmiProperties") @Mapping(source = "publicCmHandleProperties", target = "publicProperties") NcmpServiceCmHandle toNcmpServiceCmHandle(final RestInputCmHandle restInputCmHandle); RestModuleReference toRestModuleReference( final ModuleReference moduleReference); -} \ No newline at end of file + + @InheritConfiguration(name = "toRestModuleReference") + RestModuleDefinition toRestModuleDefinition( + final ModuleDefinition moduleDefinition); + + @Mapping(source = "cmHandleQueryParameters", target = "cmHandleQueryParameters", + nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, + nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.SET_TO_DEFAULT) + CmHandleQueryServiceParameters toCmHandleQueryServiceParameters( + final CmHandleQueryParameters cmHandleQueryParameters); +}