diff options
Diffstat (limited to 'cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java index 65e03f1f9..45e275422 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java @@ -69,6 +69,26 @@ public class YangModelCmHandle { private List<Property> publicProperties; /** + * Creates a deep copy of Yang Model Cm Handle. + * + * @param original Yang Model Cm Handle + * @return instance of yangModelCmHandle + */ + public static YangModelCmHandle deepCopyOf(final YangModelCmHandle original) { + final YangModelCmHandle copy = new YangModelCmHandle(); + copy.id = original.getId(); + copy.dmiServiceName = original.getDmiServiceName(); + copy.dmiDataServiceName = original.getDmiDataServiceName(); + copy.dmiModelServiceName = original.getDmiModelServiceName(); + copy.compositeState = + original.getCompositeState() == null ? null : new CompositeState(original.getCompositeState()); + copy.dmiProperties = original.getDmiProperties() == null ? null : new ArrayList<>(original.getDmiProperties()); + copy.publicProperties = + original.getPublicProperties() == null ? null : new ArrayList<>(original.getPublicProperties()); + return copy; + } + + /** * Create a yangModelCmHandle. * * @param dmiServiceName dmi service name |