Add extra authorative TOSCA concepts
[policy/models.git] / models-tosca / src / main / java / org / onap / policy / models / tosca / authorative / concepts / ToscaPolicyType.java
index d64a5fa..af8f5fa 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.models.tosca.authorative.concepts;
 
+import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.Map.Entry;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
+import lombok.NonNull;
 
 /**
  * Class to represent TOSCA policy type matching input/output from/to client.
@@ -38,4 +41,20 @@ import lombok.NoArgsConstructor;
 @NoArgsConstructor
 public class ToscaPolicyType extends ToscaEntity {
     private Map<String, ToscaProperty> properties;
+
+    /**
+     * Copy Constructor.
+     *
+     * @param copyObject object to copy from
+     */
+    public ToscaPolicyType(@NonNull ToscaPolicyType copyObject) {
+        super(copyObject);
+
+        if (copyObject.properties != null) {
+            properties = new LinkedHashMap<>();
+            for (final Entry<String, ToscaProperty> propertyEntry : copyObject.properties.entrySet()) {
+                properties.put(propertyEntry.getKey(), propertyEntry.getValue());
+            }
+        }
+    }
 }