diff options
Diffstat (limited to 'cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java index 963b484ed..ae40d330b 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java @@ -23,6 +23,7 @@ package org.onap.cps.ncmp.api.models; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import java.util.Collections; +import java.util.LinkedHashMap; import java.util.Map; import lombok.Getter; import lombok.NoArgsConstructor; @@ -51,4 +52,16 @@ public class NcmpServiceCmHandle { @JsonSetter(nulls = Nulls.AS_EMPTY) private CompositeState compositeState; + /** + * NcmpServiceCmHandle copy constructor. + * + * @param ncmpServiceCmHandle Ncmp Service CmHandle + */ + public NcmpServiceCmHandle(final NcmpServiceCmHandle ncmpServiceCmHandle) { + this.cmHandleId = ncmpServiceCmHandle.getCmHandleId(); + this.dmiProperties = new LinkedHashMap<>(ncmpServiceCmHandle.getDmiProperties()); + this.publicProperties = new LinkedHashMap<>(ncmpServiceCmHandle.getPublicProperties()); + this.compositeState = ncmpServiceCmHandle.getCompositeState() != null ? new CompositeState( + ncmpServiceCmHandle.getCompositeState()) : null; + } } |