* ONAP Policy Model
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * 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 com.google.gson.annotations.SerializedName;
+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.
* @author Chenfei Gao (cgao@research.att.com)
*/
@Data
-public class ToscaPolicyType {
-
- @SerializedName("derived_from")
- private String derivedFrom;
-
- private String version;
-
- private Map<String, String> metadata;
-
- private String description;
-
+@EqualsAndHashCode(callSuper = true)
+@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());
+ }
+ }
+ }
}