summaryrefslogtreecommitdiffstats
path: root/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements
diff options
context:
space:
mode:
Diffstat (limited to 'common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinition.java8
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterInfo.java17
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/Annotation.java65
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AnnotationTypeDataDefinition.java96
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java11
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java713
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinition.java14
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java25
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/DataTypeDataDefinition.java9
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathDataDefinition.java13
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathElementDataDefinition.java4
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinition.java14
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinition.java364
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinition.java11
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinition.java52
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/HeatParameterDataDefinition.java9
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java14
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java11
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationDataDefinition.java12
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinition.java4
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java14
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityProperty.java (renamed from common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyProperty.java)6
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java17
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java5
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinition.java (renamed from common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinition.java)8
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java5
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinition.java360
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinition.java34
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinition.java8
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java208
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyRule.java10
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java24
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java18
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinition.java13
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaTypeDataDefinition.java43
35 files changed, 1251 insertions, 988 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinition.java
index ea47342ce3..76cb358962 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterDataDefinition.java
@@ -22,15 +22,9 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.List;
-public class AdditionalInfoParameterDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -565365728516901670L;
+public class AdditionalInfoParameterDataDefinition extends ToscaDataDefinition {
private String uniqueId;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterInfo.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterInfo.java
index 94aea6d321..8dc95bc9d3 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterInfo.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AdditionalInfoParameterInfo.java
@@ -22,31 +22,22 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
+public class AdditionalInfoParameterInfo extends ToscaDataDefinition {
-public class AdditionalInfoParameterInfo extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 2066876282722907709L;
-
- String uniqueId;
- String key;
- String value;
+ private String uniqueId;
+ private String key;
+ private String value;
public AdditionalInfoParameterInfo() {
super();
}
public AdditionalInfoParameterInfo(String key, String value) {
- super();
this.key = key;
this.value = value;
}
public AdditionalInfoParameterInfo(String uniqueId, String key, String value) {
- super();
this.uniqueId = uniqueId;
this.key = key;
this.value = value;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/Annotation.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/Annotation.java
new file mode 100644
index 0000000000..e7020edcb7
--- /dev/null
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/Annotation.java
@@ -0,0 +1,65 @@
+package org.openecomp.sdc.be.datatypes.elements;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+public class Annotation {
+ private String name;
+ private String type;
+ private String description;
+ private List<PropertyDataDefinition> properties;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public List<PropertyDataDefinition> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(List<PropertyDataDefinition> properties) {
+ this.properties = properties;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public static void setAnnotationsName(Map<String, Annotation> annotations) {
+ annotations.forEach((name, annotation) -> annotation.setName(name));
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Annotation that = (Annotation) o;
+ return Objects.equals(name, that.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name);
+ }
+}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AnnotationTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AnnotationTypeDataDefinition.java
new file mode 100644
index 0000000000..81dfc13011
--- /dev/null
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AnnotationTypeDataDefinition.java
@@ -0,0 +1,96 @@
+package org.openecomp.sdc.be.datatypes.elements;
+
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+
+public class AnnotationTypeDataDefinition extends ToscaDataDefinition {
+
+ protected String uniqueId;
+ protected String type;
+ protected String description;
+
+ protected Long creationTime;
+ protected Long modificationTime;
+
+ protected String version;
+ protected boolean highestVersion;
+
+ public AnnotationTypeDataDefinition() {}
+
+ public AnnotationTypeDataDefinition(AnnotationTypeDataDefinition other) {
+ uniqueId = other.uniqueId;
+ type = other.type;
+ version = other.version;
+ description = other.description;
+ creationTime = other.creationTime;
+ modificationTime = other.modificationTime;
+ highestVersion = other.highestVersion;
+ }
+
+ public String getUniqueId() {
+ return uniqueId;
+ }
+
+ public void setUniqueId(String uniqueId) {
+ this.uniqueId = uniqueId;
+ }
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Long getCreationTime() {
+ return creationTime;
+ }
+
+ public void setCreationTime(Long creationTime) {
+ this.creationTime = creationTime;
+ }
+
+ public Long getModificationTime() {
+ return modificationTime;
+ }
+
+ public void setModificationTime(Long modificationTime) {
+ this.modificationTime = modificationTime;
+ }
+
+ @Override
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public boolean isHighestVersion() {
+ return highestVersion;
+ }
+
+ public void setHighestVersion(boolean highestVersion) {
+ this.highestVersion = highestVersion;
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getName() + ": [uniqueId=" + uniqueId + ", type=" + getType()
+ + ", version=" + version + ", highestVersion=" + highestVersion
+ + ", description=" + description
+ + ", creationTime=" + creationTime + ", modificationTime=" + modificationTime + "]";
+ }
+
+
+}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java
index b42ceab945..93519d29fe 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java
@@ -24,23 +24,15 @@ import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
//import com.google.gson.reflect.TypeToken;
-public class ArtifactDataDefinition extends ToscaDataDefinition implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = -1691343090754083941L;
-
-
+public class ArtifactDataDefinition extends ToscaDataDefinition {
public ArtifactDataDefinition() {
- super();
setArtifactVersion("0");
}
@@ -52,7 +44,6 @@ public class ArtifactDataDefinition extends ToscaDataDefinition implements Seria
public ArtifactDataDefinition(ArtifactDataDefinition a ) {
- super();
this.setUniqueId(a.getUniqueId());
this.setArtifactType(a.getArtifactType());
this.setArtifactRef( a.getArtifactRef());
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java
index 9327499981..fdd1386e48 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,347 +24,450 @@ import com.google.common.collect.Lists;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* Represents the capability of the component or component instance
*/
-public class CapabilityDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 7544984873506188920L;
- public static final String MIN_OCCURRENCES = "1";
- public static final String MAX_OCCURRENCES = "UNBOUNDED";
-
- /**
- * The default constructor initializing limits of the occurrences
- */
- public CapabilityDataDefinition() {
- super();
- this.setMinOccurrences( MIN_OCCURRENCES );
- this.setMaxOccurrences( MAX_OCCURRENCES);
- this.setLeftOccurrences( MAX_OCCURRENCES);
+public class CapabilityDataDefinition extends ToscaDataDefinition {
+
+ public static final String MIN_OCCURRENCES = "1";
+ public static final String MAX_OCCURRENCES = "UNBOUNDED";
+
+ /**
+ * The default constructor initializing limits of the occurrences
+ */
+ public CapabilityDataDefinition() {
+ this.setMinOccurrences(MIN_OCCURRENCES);
+ this.setMaxOccurrences(MAX_OCCURRENCES);
+ this.setLeftOccurrences(MAX_OCCURRENCES);
+ }
+
+ /**
+ * Deep copy constructor
+ *
+ * @param other
+ */
+ public CapabilityDataDefinition(CapabilityDataDefinition other) {
+ this.setUniqueId(other.getUniqueId());
+ this.setType(other.getType());
+ this.setDescription(other.getDescription());
+ this.setName(other.getName());
+ this.setParentName(other.getParentName());
+ this.setPreviousName(other.getPreviousName());
+
+ if (other.getValidSourceTypes() == null) {
+ this.setValidSourceTypes(Lists.newArrayList());
+ }
+ else {
+ this.setValidSourceTypes(Lists.newArrayList(other.getValidSourceTypes()));
+ }
+
+ if (other.getCapabilitySources() == null) {
+ this.setCapabilitySources(Lists.newArrayList());
+ }
+ else {
+ this.setCapabilitySources(Lists.newArrayList(other.getCapabilitySources()));
+ }
+
+ this.setOwnerId(other.getOwnerId());
+ this.setOwnerName(other.getOwnerName());
+ this.setOwnerType(other.getOwnerType());
+ this.setMinOccurrences(other.getMinOccurrences());
+ this.setMaxOccurrences(other.getMaxOccurrences());
+ this.setLeftOccurrences(other.getLeftOccurrences());
+
+ if (other.getPath() == null) {
+ this.setPath(Lists.newArrayList());
+ }
+ else {
+ this.setPath(Lists.newArrayList(other.getPath()));
+ }
+
+ this.setSource(other.getSource());
+ this.setOwnerType(other.getOwnerType());
}
- /**
- * Deep copy constructor
- * @param other
- */
- public CapabilityDataDefinition(CapabilityDataDefinition other) {
- super();
+
+ public CapabilityDataDefinition(CapabilityTypeDataDefinition other) {
+ super();
this.setUniqueId(other.getUniqueId());
- this.setType(other.getType());
- this.setDescription ( other.getDescription());
- this.setName( other.getName());
- this.setParentName( other.getParentName());
-
+ this.setType(other.getType());
+ this.setDescription(other.getDescription());
+ this.setOwnerId(other.getOwnerId());
if(other.getValidSourceTypes() == null)
this.setValidSourceTypes(Lists.newArrayList());
else
this.setValidSourceTypes(Lists.newArrayList(other.getValidSourceTypes()));
-
- if(other.getCapabilitySources() == null)
- this.setCapabilitySources(Lists.newArrayList());
- else
- this.setCapabilitySources(Lists.newArrayList(other.getCapabilitySources()));
-
- this.setOwnerId( other.getOwnerId());
- this.setOwnerName( other.getOwnerName());
- this.setMinOccurrences( other.getMinOccurrences());
- this.setMaxOccurrences( other.getMaxOccurrences());
- this.setLeftOccurrences(other.getLeftOccurrences());
-
- if(other.getPath() == null)
- this.setPath(Lists.newArrayList());
- else
- this.setPath(Lists.newArrayList(other.getPath()));
-
- this.setSource(other.getSource());
-
- }
+ this.setOwnerId(other.getOwnerId());
+ }
- @Override
- public String getOwnerId() {
- return (String) getToscaPresentationValue(JsonPresentationFields.OWNER_ID);
- }
-
- @Override
- public void setOwnerId(String ownerId) {
- setToscaPresentationValue(JsonPresentationFields.OWNER_ID, ownerId);
- }
+ @Override
+ public String getOwnerId() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.OWNER_ID);
+ }
- public String getOwnerName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.OWNER_NAME);
- }
+ @Override
+ public void setOwnerId(String ownerId) {
+ setToscaPresentationValue(JsonPresentationFields.OWNER_ID, ownerId);
+ }
- public void setOwnerName(String ownerName) {
- setToscaPresentationValue(JsonPresentationFields.OWNER_NAME, ownerName);
- }
+ public String getOwnerName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.OWNER_NAME);
+ }
- public String getMinOccurrences() {
- return (String) getToscaPresentationValue(JsonPresentationFields.MIN_OCCURRENCES);
- }
+ public void setOwnerName(String ownerName) {
+ setToscaPresentationValue(JsonPresentationFields.OWNER_NAME, ownerName);
+ }
- public void setMinOccurrences(String minOccurrences) {
- setToscaPresentationValue(JsonPresentationFields.MIN_OCCURRENCES, minOccurrences);
+ public OwnerType getOwnerType() {
+ return OwnerType.getByValue((String) getToscaPresentationValue(JsonPresentationFields.OWNER_TYPE));
}
- public String getMaxOccurrences() {
- return (String) getToscaPresentationValue(JsonPresentationFields.MAX_OCCURRENCES);
+ public void setOwnerType(OwnerType ownerType) {
+ if(ownerType != null)
+ setToscaPresentationValue(JsonPresentationFields.OWNER_TYPE, ownerType.getValue());
}
- public void setMaxOccurrences(String maxOccurrences) {
- setToscaPresentationValue(JsonPresentationFields.MAX_OCCURRENCES, maxOccurrences);
- }
- public String getLeftOccurrences() {
- return (String) getToscaPresentationValue(JsonPresentationFields.LEFT_OCCURRENCES);
- }
+ public String getMinOccurrences() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.MIN_OCCURRENCES);
+ }
- public void setLeftOccurrences(String leftOccurrences) {
- setToscaPresentationValue(JsonPresentationFields.LEFT_OCCURRENCES, leftOccurrences);
- }
-
- public String getUniqueId() {
- return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
- }
+ public void setMinOccurrences(String minOccurrences) {
+ setToscaPresentationValue(JsonPresentationFields.MIN_OCCURRENCES, minOccurrences);
+ }
- public void setUniqueId(String uniqueId) {
- setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
- }
+ public String getMaxOccurrences() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.MAX_OCCURRENCES);
+ }
- public String getDescription() {
- return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
- }
+ public void setMaxOccurrences(String maxOccurrences) {
+ setToscaPresentationValue(JsonPresentationFields.MAX_OCCURRENCES, maxOccurrences);
+ }
- public void setDescription(String description) {
- setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
- }
+ public String getLeftOccurrences() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.LEFT_OCCURRENCES);
+ }
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
+ public void setLeftOccurrences(String leftOccurrences) {
+ setToscaPresentationValue(JsonPresentationFields.LEFT_OCCURRENCES, leftOccurrences);
+ }
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
- public String getParentName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.PARENT_NAME);
- }
+ public String getUniqueId() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
+ }
- public void setParentName(String parentName) {
- setToscaPresentationValue(JsonPresentationFields.PARENT_NAME, parentName);
- }
+ public void setUniqueId(String uniqueId) {
+ setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
+ }
- public String getType() {
- return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
- }
+ public String getDescription() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
+ }
- public void setType(String type) {
- setToscaPresentationValue(JsonPresentationFields.TYPE, type);
- }
+ public void setDescription(String description) {
+ setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
+ }
- @SuppressWarnings("unchecked")
- public List<String> getValidSourceTypes() {
- return (List<String>) getToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPE);
- }
+ public String getName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
+ }
- public void setValidSourceTypes(List<String> validSourceTypes) {
- setToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPE, validSourceTypes);
- }
+ public void setName(String name) {
+ setToscaPresentationValue(JsonPresentationFields.NAME, name);
+ }
- @SuppressWarnings("unchecked")
- public List<String> getCapabilitySources() {
- return (List<String>) getToscaPresentationValue(JsonPresentationFields.CAPABILITY_SOURCES);
- }
-
- public void setCapabilitySources(List<String> capabilitySources) {
- setToscaPresentationValue(JsonPresentationFields.CAPABILITY_SOURCES, capabilitySources);
- }
+ public String getParentName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.PARENT_NAME);
+ }
- public void setPath(List<String> path){
- setToscaPresentationValue(JsonPresentationFields.PATH, path);
- }
- @SuppressWarnings("unchecked")
- public List<String> getPath() {
- return (List<String>) getToscaPresentationValue(JsonPresentationFields.PATH);
- }
- public void setSource(String source){
- setToscaPresentationValue(JsonPresentationFields.SOURCE, source);
- }
- public String getSource() {
- return (String) getToscaPresentationValue(JsonPresentationFields.SOURCE);
+ public void setParentName(String parentName) {
+ setToscaPresentationValue(JsonPresentationFields.PARENT_NAME, parentName);
+ }
+
+ public String getPreviousName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.PREVIOUS_NAME);
+ }
+
+ public void setPreviousName(String previousName) {
+ setToscaPresentationValue(JsonPresentationFields.PREVIOUS_NAME, previousName);
+ }
+
+ public String getType() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
+ }
+
+ public void setType(String type) {
+ setToscaPresentationValue(JsonPresentationFields.TYPE, type);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getValidSourceTypes() {
+ return (List<String>) getToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPE);
+ }
+
+ public void setValidSourceTypes(List<String> validSourceTypes) {
+ setToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPE, validSourceTypes);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getCapabilitySources() {
+ return (List<String>) getToscaPresentationValue(JsonPresentationFields.CAPABILITY_SOURCES);
+ }
+
+ public void setCapabilitySources(List<String> capabilitySources) {
+ setToscaPresentationValue(JsonPresentationFields.CAPABILITY_SOURCES, capabilitySources);
+ }
+
+ public void setPath(List<String> path) {
+ setToscaPresentationValue(JsonPresentationFields.PATH, path);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getPath() {
+ return (List<String>) getToscaPresentationValue(JsonPresentationFields.PATH);
+ }
+
+ public void setSource(String source) {
+ setToscaPresentationValue(JsonPresentationFields.SOURCE, source);
+ }
+
+ public String getSource() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.SOURCE);
+ }
+
+ /**
+ * Adds the element to the path avoiding duplication
+ *
+ * @param elementInPath
+ */
+ public void addToPath(String elementInPath) {
+ List<String> path = getPath();
+ if (path == null) {
+ path = new ArrayList<>();
+ }
+ if (!path.contains(elementInPath)) {
+ path.add(elementInPath);
+ }
+ setPath(path);
+ }
+
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+
+ String uniqueId = this.getUniqueId();
+ String description = this.getDescription();
+ String name = this.getName();
+ String type = this.getType();
+ List<String> validSourceTypes = this.getValidSourceTypes();
+ List<String> capabilitySources = this.getCapabilitySources();
+ List<String> path = this.getPath();
+
+ String ownerId = this.getOwnerId();
+ String ownerName = this.getOwnerName();
+ String minOccurrences = this.getMinOccurrences();
+ String maxOccurrences = this.getMaxOccurrences();
+ String leftOccurrences = getLeftOccurrences();
+ String source = getSource();
+
+ result = prime * result + ((capabilitySources == null) ? 0 : capabilitySources.hashCode());
+ result = prime * result + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((maxOccurrences == null) ? 0 : maxOccurrences.hashCode());
+ result = prime * result + ((minOccurrences == null) ? 0 : minOccurrences.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
+ result = prime * result + ((ownerName == null) ? 0 : ownerName.hashCode());
+
+ result = prime * result + ((type == null) ? 0 : type.hashCode());
+ result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
+ result = prime * result + ((validSourceTypes == null) ? 0 : validSourceTypes.hashCode());
+ result = prime * result + ((leftOccurrences == null) ? 0 : leftOccurrences.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ result = prime * result + ((source == null) ? 0 : source.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+
+ String uniqueId = this.getUniqueId();
+ String description = this.getDescription();
+ String name = this.getName();
+ String type = this.getType();
+ List<String> validSourceTypes = this.getValidSourceTypes();
+ List<String> capabilitySources = this.getCapabilitySources();
+ String ownerId = this.getOwnerId();
+ String ownerName = this.getOwnerName();
+ String minOccurrences = this.getMinOccurrences();
+ String maxOccurrences = this.getMaxOccurrences();
+ String leftOccurrences = getLeftOccurrences();
+ List<String> path = this.getPath();
+ String source = getSource();
+
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ CapabilityDataDefinition other = (CapabilityDataDefinition) obj;
+ if (capabilitySources == null) {
+ if (other.getCapabilitySources() != null) {
+ return false;
+ }
+ }
+ else if (!capabilitySources.equals(other.getCapabilitySources())) {
+ return false;
+ }
+ if (description == null) {
+ if (other.getDescription() != null) {
+ return false;
+ }
+ }
+ else if (!description.equals(other.getDescription())) {
+ return false;
+ }
+ if (maxOccurrences == null) {
+ if (other.getMaxOccurrences() != null) {
+ return false;
+ }
+ }
+ else if (!maxOccurrences.equals(other.getMaxOccurrences())) {
+ return false;
+ }
+ if (minOccurrences == null) {
+ if (other.getMinOccurrences() != null) {
+ return false;
+ }
+ }
+ else if (!minOccurrences.equals(other.getMinOccurrences())) {
+ return false;
+ }
+ if (name == null) {
+ if (other.getName() != null) {
+ return false;
+ }
+ }
+ else if (!name.equals(other.getName())) {
+ return false;
+ }
+ if (ownerId == null) {
+ if (other.getOwnerId() != null) {
+ return false;
+ }
+ }
+ else if (!ownerId.equals(other.getOwnerId())) {
+ return false;
+ }
+ if (ownerName == null) {
+ if (other.getOwnerName() != null) {
+ return false;
+ }
+ }
+ else if (!ownerName.equals(other.getOwnerName())) {
+ return false;
+ }
+ if (type == null) {
+ if (other.getType() != null) {
+ return false;
+ }
+ }
+ else if (!type.equals(other.getType())) {
+ return false;
+ }
+ if (uniqueId == null) {
+ if (other.getUniqueId() != null) {
+ return false;
+ }
+ }
+ else if (!uniqueId.equals(other.getUniqueId())) {
+ return false;
+ }
+ if (validSourceTypes == null) {
+ if (other.getValidSourceTypes() != null) {
+ return false;
+ }
+ }
+ else if (!validSourceTypes.equals(other.getValidSourceTypes())) {
+ return false;
+ }
+ if (leftOccurrences == null) {
+ if (other.getLeftOccurrences() != null) {
+ return false;
+ }
+ }
+ else if (!leftOccurrences.equals(other.getLeftOccurrences())) {
+ return false;
+ }
+ if (path == null) {
+ if (other.getPath() != null) {
+ return false;
+ }
+ }
+ else if (!path.equals(other.getPath())) {
+ return false;
+ }
+ if (source == null) {
+ if (other.getSource() != null) {
+ return false;
+ }
+ }
+ else if (!source.equals(other.getSource())) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ String uniqueId = this.getUniqueId();
+ String description = this.getDescription();
+ String name = this.getName();
+ String type = this.getType();
+ List<String> validSourceTypes = this.getValidSourceTypes();
+ List<String> capabilitySources = this.getCapabilitySources();
+ List<String> path = this.getPath();
+ String ownerId = this.getOwnerId();
+ String ownerName = this.getOwnerName();
+ String minOccurrences = this.getMinOccurrences();
+ String maxOccurrences = this.getMaxOccurrences();
+ String source = this.getSource();
+
+
+ return "CapabilityDefinition [uniqueId=" + uniqueId + ", description=" + description + ", name=" + name
+ + ", type=" + type + ", validSourceTypes=" + validSourceTypes + ", capabilitySources="
+ + capabilitySources + ", ownerId=" + ownerId + ", ownerName=" + ownerName
+ + ", minOccurrences=" + minOccurrences + ", maxOccurrences=" + maxOccurrences + ", path=" + path + ", source=" + source + "]";
}
-
- /**
- * Adds the element to the path avoiding duplication
- * @param elementInPath
- */
- public void addToPath(String elementInPath){
- List<String> path = getPath();
- if ( path == null ){
- path = new ArrayList<>();
+
+ public enum OwnerType{
+ GROUP("group"),
+ COMPONENT_INSTANCE("component instance"),
+ RESOURCE("resource");
+
+ private String value;
+
+ private OwnerType(String value) {
+ this.value = value;
}
- if(!path.contains(elementInPath)){
- path.add(elementInPath);
+
+ public String getValue() {
+ return value;
}
- setPath(path);
- }
-
-
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
-
- String uniqueId = this.getUniqueId();
- String description = this.getDescription();
- String name = this.getName();
- String type = this.getType();
- List<String> validSourceTypes = this.getValidSourceTypes();
- List<String> capabilitySources = this.getCapabilitySources();
- List<String> path = this.getPath();
-
- String ownerId = this.getOwnerId();
- String ownerName = this.getOwnerName();
- String minOccurrences = this.getMinOccurrences();
- String maxOccurrences = this.getMaxOccurrences();
- String leftOccurrences = getLeftOccurrences();
- String source = getSource();
-
- result = prime * result + ((capabilitySources == null) ? 0 : capabilitySources.hashCode());
- result = prime * result + ((description == null) ? 0 : description.hashCode());
- result = prime * result + ((maxOccurrences == null) ? 0 : maxOccurrences.hashCode());
- result = prime * result + ((minOccurrences == null) ? 0 : minOccurrences.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
- result = prime * result + ((ownerName == null) ? 0 : ownerName.hashCode());
-
- result = prime * result + ((type == null) ? 0 : type.hashCode());
- result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
- result = prime * result + ((validSourceTypes == null) ? 0 : validSourceTypes.hashCode());
- result = prime * result + ((leftOccurrences == null) ? 0 : leftOccurrences.hashCode());
- result = prime * result + ((path == null) ? 0 : path.hashCode());
- result = prime * result + ((source == null) ? 0 : source.hashCode());
- return result;
- }
- @Override
- public boolean equals(Object obj) {
-
- String uniqueId = this.getUniqueId();
- String description = this.getDescription();
- String name = this.getName();
- String type = this.getType();
- List<String> validSourceTypes = this.getValidSourceTypes();
- List<String> capabilitySources = this.getCapabilitySources();
- String ownerId = this.getOwnerId();
- String ownerName = this.getOwnerName();
- String minOccurrences = this.getMinOccurrences();
- String maxOccurrences = this.getMaxOccurrences();
- String leftOccurrences = getLeftOccurrences();
- List<String> path = this.getPath();
- String source = getSource();
-
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CapabilityDataDefinition other = (CapabilityDataDefinition) obj;
- if (capabilitySources == null) {
- if (other.getCapabilitySources() != null)
- return false;
- } else if (!capabilitySources.equals(other.getCapabilitySources()))
- return false;
- if (description == null) {
- if (other.getDescription() != null)
- return false;
- } else if (!description.equals(other.getDescription()))
- return false;
- if (maxOccurrences == null) {
- if (other.getMaxOccurrences() != null)
- return false;
- } else if (!maxOccurrences.equals(other.getMaxOccurrences()))
- return false;
- if (minOccurrences == null) {
- if (other.getMinOccurrences() != null)
- return false;
- } else if (!minOccurrences.equals(other.getMinOccurrences()))
- return false;
- if (name == null) {
- if (other.getName() != null)
- return false;
- } else if (!name.equals(other.getName()))
- return false;
- if (ownerId == null) {
- if (other.getOwnerId() != null)
- return false;
- } else if (!ownerId.equals(other.getOwnerId()))
- return false;
- if (ownerName == null) {
- if (other.getOwnerName() != null)
- return false;
- } else if (!ownerName.equals(other.getOwnerName()))
- return false;
- if (type == null) {
- if (other.getType() != null)
- return false;
- } else if (!type.equals(other.getType()))
- return false;
- if (uniqueId == null) {
- if (other.getUniqueId() != null)
- return false;
- } else if (!uniqueId.equals(other.getUniqueId()))
- return false;
- if (validSourceTypes == null) {
- if (other.getValidSourceTypes() != null)
- return false;
- } else if (!validSourceTypes.equals(other.getValidSourceTypes()))
- return false;
- if (leftOccurrences == null) {
- if (other.getLeftOccurrences() != null)
- return false;
- } else if (!leftOccurrences.equals(other.getLeftOccurrences()))
- return false;
- if (path == null) {
- if (other.getPath() != null)
- return false;
- } else if (!path.equals(other.getPath()))
- return false;
- if (source == null) {
- if (other.getSource() != null)
- return false;
- } else if (!source.equals(other.getSource()))
- return false;
- return true;
- }
+ public static OwnerType getByValue(String value){
+ for(OwnerType type : values())
+ if(type.getValue().equals(value))
+ return type;
+ return null;
+ }
- @Override
- public String toString() {
- String uniqueId = this.getUniqueId();
- String description = this.getDescription();
- String name = this.getName();
- String type = this.getType();
- List<String> validSourceTypes = this.getValidSourceTypes();
- List<String> capabilitySources = this.getCapabilitySources();
- List<String> path = this.getPath();
- String ownerId = this.getOwnerId();
- String ownerName = this.getOwnerName();
- String minOccurrences = this.getMinOccurrences();
- String maxOccurrences = this.getMaxOccurrences();
- String source = this.getSource();
-
-
- return "CapabilityDefinition [uniqueId=" + uniqueId + ", description=" + description + ", name=" + name
- + ", type=" + type + ", validSourceTypes=" + validSourceTypes + ", capabilitySources="
- + capabilitySources + ", ownerId=" + ownerId + ", ownerName=" + ownerName
- + ", minOccurrences=" + minOccurrences + ", maxOccurrences=" + maxOccurrences + ", path=" + path+ ", source=" + source + "]";
- }
+ }
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinition.java
index cecb4f1bf9..ac3e5d2fab 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityTypeDataDefinition.java
@@ -23,22 +23,11 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.List;
-public class CapabilityTypeDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 3242123405337612089L;
-
-
-
- // private String derivedFrom;
+public class CapabilityTypeDataDefinition extends ToscaDataDefinition {
public CapabilityTypeDataDefinition(CapabilityTypeDataDefinition cdt) {
- super();
this.setUniqueId(cdt.getUniqueId());
this.setDescription ( cdt.getDescription());
this.setType(cdt.getType());
@@ -46,7 +35,6 @@ public class CapabilityTypeDataDefinition extends ToscaDataDefinition implements
this.setVersion( cdt.getVersion());
this.setCreationTime (cdt.getCreationTime());
this.setModificationTime (cdt.getModificationTime());
-
}
public CapabilityTypeDataDefinition() {
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java
index 384796b965..4a4a7a4b75 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java
@@ -25,18 +25,9 @@ import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
import org.openecomp.sdc.common.util.ValidationUtils;
-import java.io.Serializable;
-
-public class ComponentInstanceDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
-
- private static final long serialVersionUID = 7215033872921497743L;
+public class ComponentInstanceDataDefinition extends ToscaDataDefinition {
public ComponentInstanceDataDefinition() {
- super();
setPropertyValueCounter(1);
setAttributeValueCounter(1);
setInputValueCounter(1);
@@ -66,6 +57,7 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition impleme
setSourceModelUuid(dataDefinition.getSourceModelUuid());
setSourceModelUid(dataDefinition.getSourceModelUid());
setIsProxy(dataDefinition.getIsProxy());
+ setOriginArchived(dataDefinition.isOriginArchived());
}
public String getIcon() {
@@ -273,6 +265,19 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition impleme
return ( isProxy != null ) ? isProxy : false;
}
+ public void setOriginArchived(Boolean originArchived) {
+ if (originArchived == null) {
+ setToscaPresentationValue(JsonPresentationFields.CI_IS_ORIGIN_ARCHIVED, false);
+ } else {
+ setToscaPresentationValue(JsonPresentationFields.CI_IS_ORIGIN_ARCHIVED, originArchived);
+ }
+ }
+
+ public Boolean isOriginArchived() {
+ Boolean originArchived = (Boolean) getToscaPresentationValue(JsonPresentationFields.CI_IS_ORIGIN_ARCHIVED);
+ return ( originArchived != null ) ? originArchived : false;
+ }
+
@Override
public String toString() {
return "ComponentInstanceDataDefinition [icon=" + getIcon() + ", uniqueId=" + getUniqueId() + ", name="
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/DataTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/DataTypeDataDefinition.java
index 923c47de58..358f8ef614 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/DataTypeDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/DataTypeDataDefinition.java
@@ -22,14 +22,7 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
-
-public class DataTypeDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 1751768352205892172L;
+public class DataTypeDataDefinition extends ToscaDataDefinition {
private String name;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathDataDefinition.java
index bf63e20d38..aa36fc96b2 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathDataDefinition.java
@@ -1,18 +1,11 @@
package org.openecomp.sdc.be.datatypes.elements;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.DESCRIPTION;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.PATH_DESTINATION_PORT_NUMBER;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.PATH_ELEMENT_LIST;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.PATH_NAME;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.PATH_PROTOCOL;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.UNIQUE_ID;
-
import com.fasterxml.jackson.annotation.JsonCreator;
-import java.io.Serializable;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-public class ForwardingPathDataDefinition extends ToscaDataDefinition implements Serializable {
+import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.*;
+
+public class ForwardingPathDataDefinition extends ToscaDataDefinition {
@JsonCreator
public ForwardingPathDataDefinition() {
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathElementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathElementDataDefinition.java
index 3bbe9cae70..50e9c40ef9 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathElementDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ForwardingPathElementDataDefinition.java
@@ -5,10 +5,9 @@ import com.google.common.base.MoreObjects;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.Objects;
-public class ForwardingPathElementDataDefinition extends ToscaDataDefinition implements Serializable {
+public class ForwardingPathElementDataDefinition extends ToscaDataDefinition {
@JsonCreator
public ForwardingPathElementDataDefinition() {
super();
@@ -22,7 +21,6 @@ public class ForwardingPathElementDataDefinition extends ToscaDataDefinition imp
setToCP(toCPName);
setFromCPOriginId(fromCPOriginId);
setToCPOriginId(toCPOriginId);
-
}
public ForwardingPathElementDataDefinition(ForwardingPathElementDataDefinition pathElement) {
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinition.java
index 131d41a06a..5ce336c805 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetInputValueDataDefinition.java
@@ -22,21 +22,17 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.Map;
-public class GetInputValueDataDefinition extends ToscaDataDefinition implements Serializable{
- /**
- *
- */
- private static final long serialVersionUID = 5466910697527037975L;
+public class GetInputValueDataDefinition extends ToscaDataDefinition {
+
private String propName;
private String inputName;
private String inputId;
private Integer indexValue;
private GetInputValueDataDefinition getInputIndex;
- boolean isList = false;
+ private boolean isList = false;
public GetInputValueDataDefinition(){
super();
@@ -44,13 +40,9 @@ public class GetInputValueDataDefinition extends ToscaDataDefinition implements
public GetInputValueDataDefinition(Map<String, Object> pr) {
super(pr);
-
}
public GetInputValueDataDefinition(GetInputValueDataDefinition p) {
-
-
- super();
this.setPropName(p.getPropName());
this.setInputName( p.getInputName());
this.setInputId( p.getInputId());
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinition.java
index c46e21166c..1e03372b32 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupDataDefinition.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,176 +20,210 @@
package org.openecomp.sdc.be.datatypes.elements;
+import org.openecomp.sdc.be.datatypes.enums.CreatedFrom;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import static java.util.Collections.emptyMap;
-public class GroupDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 1565606165279109427L;
-
- private String typeUid;
-
- private Integer propertyValueCounter = 0;
-
- public GroupDataDefinition() {
- super();
-
- }
-
- public GroupDataDefinition(Map<String, Object> gr) {
- super(gr);
- propertyValueCounter = 0;
- }
-
- public GroupDataDefinition(GroupDataDefinition other) {
- this.setName(other.getName());
- this.setUniqueId(other.getUniqueId());
- this.setType(other.getType());
- this.setVersion(other.getVersion());
- this.setInvariantUUID(other.getInvariantUUID());
- this.setDescription(other.getDescription());
- this.propertyValueCounter = other.propertyValueCounter;
- this.setGroupUUID(other.getGroupUUID());
-
- if (other.getMembers() != null) {
- this.setMembers(new HashMap<String, String>(other.getMembers()));
- }
- if (other.getArtifacts() != null) {
- this.setArtifacts(new ArrayList<String>(other.getArtifacts()));
- }
-
- if (other.getArtifactsUuid() != null) {
- this.setArtifactsUuid( new ArrayList<String>(other.getArtifactsUuid()));
- }
- this.setTypeUid(other.typeUid);
- this.setProperties(other.getProperties());
- }
-
-
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
- public String getUniqueId() {
- return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
- }
-
- public void setUniqueId(String uniqueId) {
- setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
- }
-
- public String getType() {
- return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
- }
-
- public void setType(String type) {
- setToscaPresentationValue(JsonPresentationFields.TYPE, type);
- }
-
- public String getVersion() {
- return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
- }
-
- public void setVersion(String version) {
- setToscaPresentationValue(JsonPresentationFields.VERSION, version);
- }
-
- public String getInvariantUUID() {
- return (String) getToscaPresentationValue(JsonPresentationFields.INVARIANT_UUID);
- }
-
- public void setInvariantUUID(String invariantUUID) {
- setToscaPresentationValue(JsonPresentationFields.INVARIANT_UUID, invariantUUID);
- }
-
- public String getDescription() {
- return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
- }
-
- public void setDescription(String description) {
- setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
- }
-
- public Integer getPropertyValueCounter() {
- return propertyValueCounter;
- }
-
- public void setPropertyValueCounter(Integer propertyValueCounter) {
- this.propertyValueCounter = propertyValueCounter;
- }
-
- public String getGroupUUID() {
- return (String) getToscaPresentationValue(JsonPresentationFields.GROUP_UUID);
- }
-
- public void setGroupUUID(String groupUUID) {
- setToscaPresentationValue(JsonPresentationFields.GROUP_UUID, groupUUID);
- }
-
- public Map<String, String> getMembers() {
- return (Map<String, String>) getToscaPresentationValue(JsonPresentationFields.GROUP_MEMBER);
- }
-
- public void setMembers(Map<String, String> members) {
- setToscaPresentationValue(JsonPresentationFields.GROUP_MEMBER, members);
- }
-
- public List<String> getArtifacts() {
- return (List<String> ) getToscaPresentationValue(JsonPresentationFields.GROUP_ARTIFACTS);
- }
-
- public void setArtifacts(List<String> artifacts) {
- setToscaPresentationValue(JsonPresentationFields.GROUP_ARTIFACTS, artifacts);
- }
-
- public List<String> getArtifactsUuid() {
- return (List<String> ) getToscaPresentationValue(JsonPresentationFields.GROUP_ARTIFACTS_UUID);
- }
-
- public void setArtifactsUuid(List<String> artifactsUuid) {
- setToscaPresentationValue(JsonPresentationFields.GROUP_ARTIFACTS_UUID, artifactsUuid);
- }
-
- public List<PropertyDataDefinition> getProperties() {
- return (List<PropertyDataDefinition> ) getToscaPresentationValue(JsonPresentationFields.GROUP_PROPERTIES);
- }
-
- public void setProperties(List<PropertyDataDefinition> properties) {
- setToscaPresentationValue(JsonPresentationFields.GROUP_PROPERTIES, properties);
- }
-
- public String getTypeUid() {
- return typeUid;
- }
-
- public void setTypeUid(String typeUid) {
- this.typeUid = typeUid;
- }
-
- @Override
- public String toString() {
- return "GroupDataDefinition [propertyValueCounter=" + propertyValueCounter + ", toscaPresentation=" + toscaPresentation + ", getName()=" + getName() + ", getUniqueId()=" + getUniqueId() + ", getType()=" + getType() + ", getVersion()="
- + getVersion() + ", getInvariantUUID()=" + getInvariantUUID() + ", getDescription()=" + getDescription() + ", getPropertyValueCounter()=" + getPropertyValueCounter() + ", getGroupUUID()=" + getGroupUUID() + ", getMembers()="
- + getMembers() + ", getArtifacts()=" + getArtifacts() + ", getArtifactsUuid()=" + getArtifactsUuid() + ", getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()="
- + super.toString() + "]";
- }
-
-
- public boolean containsInstanceAsMember(String instanceId) {
- return getMembers() != null && getMembers().values().contains(instanceId);
- }
+
+public class GroupDataDefinition extends ToscaDataDefinition {
+
+ private String typeUid;
+
+ private Integer propertyValueCounter = 0;
+
+ public GroupDataDefinition() {
+ }
+
+ public GroupDataDefinition(Map<String, Object> gr) {
+ super(gr);
+ propertyValueCounter = 0;
+ }
+
+ public GroupDataDefinition(GroupDataDefinition other) {
+ this.setName(other.getName());
+ this.setUniqueId(other.getUniqueId());
+ this.setType(other.getType());
+ this.setVersion(other.getVersion());
+ this.setInvariantUUID(other.getInvariantUUID());
+ this.setDescription(other.getDescription());
+ this.propertyValueCounter = other.propertyValueCounter;
+ this.setGroupUUID(other.getGroupUUID());
+ this.setInvariantName(other.getInvariantName());
+ this.setCreatedFrom(other.getCreatedFrom());
+
+ if (other.getMembers() != null) {
+ this.setMembers(new HashMap<>(other.getMembers()));
+ }
+ if (other.getArtifacts() != null) {
+ this.setArtifacts(new ArrayList<>(other.getArtifacts()));
+ }
+
+ if (other.getArtifactsUuid() != null) {
+ this.setArtifactsUuid(new ArrayList<>(other.getArtifactsUuid()));
+ }
+ if (other.getProperties() != null) {
+ this.setProperties(new ArrayList<>(other.getProperties()));
+ }
+ this.setTypeUid(other.typeUid);
+ }
+
+
+ public String getName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
+ }
+
+ public void setName(String name) {
+ setToscaPresentationValue(JsonPresentationFields.NAME, name);
+ }
+
+ public String getInvariantName() {
+ String invariantName = (String) getToscaPresentationValue(JsonPresentationFields.CI_INVARIANT_NAME);
+ return invariantName == null ? getName() : invariantName;
+ }
+
+ public void setInvariantName(String invariantName) {
+ setToscaPresentationValue(JsonPresentationFields.CI_INVARIANT_NAME, invariantName);
+ }
+
+ public CreatedFrom getCreatedFrom() {
+ String createdFrom = (String) getToscaPresentationValue(JsonPresentationFields.CREATED_FROM);
+ return createdFrom == null ? CreatedFrom.CSAR : CreatedFrom.valueOf(createdFrom);
+ }
+
+ public void setCreatedFrom(CreatedFrom createdFrom) {
+ setToscaPresentationValue(JsonPresentationFields.CREATED_FROM, createdFrom.name());
+ }
+
+ public String getUniqueId() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
+ }
+
+ public void setUniqueId(String uniqueId) {
+ setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
+ }
+
+ public String getType() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
+ }
+
+ public void setType(String type) {
+ setToscaPresentationValue(JsonPresentationFields.TYPE, type);
+ }
+
+ public String getVersion() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
+ }
+
+ public void setVersion(String version) {
+ setToscaPresentationValue(JsonPresentationFields.VERSION, version);
+ }
+
+ public String getInvariantUUID() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.INVARIANT_UUID);
+ }
+
+ public void setInvariantUUID(String invariantUUID) {
+ setToscaPresentationValue(JsonPresentationFields.INVARIANT_UUID, invariantUUID);
+ }
+
+ public String getDescription() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
+ }
+
+ public void setDescription(String description) {
+ setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
+ }
+
+ public Integer getPropertyValueCounter() {
+ return propertyValueCounter;
+ }
+
+ public void setPropertyValueCounter(Integer propertyValueCounter) {
+ this.propertyValueCounter = propertyValueCounter;
+ }
+
+ public String getGroupUUID() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.GROUP_UUID);
+ }
+
+ public void setGroupUUID(String groupUUID) {
+ setToscaPresentationValue(JsonPresentationFields.GROUP_UUID, groupUUID);
+ }
+
+ public Map<String, String> getMembers() {
+ return (Map<String, String>) getToscaPresentationValue(JsonPresentationFields.GROUP_MEMBER);
+ }
+ //this is used by GroupCompositionMixin
+ public Map<String, String> resolveMembersList() {
+ Map<String, String> members = getMembers();
+ if (members != null) {
+ return members;
+ }
+ return emptyMap();
+
+ }
+
+ public void setMembers(Map<String, String> members) {
+ setToscaPresentationValue(JsonPresentationFields.GROUP_MEMBER, members);
+ }
+
+ public List<String> getArtifacts() {
+ return (List<String>) getToscaPresentationValue(JsonPresentationFields.GROUP_ARTIFACTS);
+ }
+
+ public void setArtifacts(List<String> artifacts) {
+ setToscaPresentationValue(JsonPresentationFields.GROUP_ARTIFACTS, artifacts);
+ }
+
+ public List<String> getArtifactsUuid() {
+ return (List<String>) getToscaPresentationValue(JsonPresentationFields.GROUP_ARTIFACTS_UUID);
+ }
+
+ public void setArtifactsUuid(List<String> artifactsUuid) {
+ setToscaPresentationValue(JsonPresentationFields.GROUP_ARTIFACTS_UUID, artifactsUuid);
+ }
+
+ public List<PropertyDataDefinition> getProperties() {
+ return (List<PropertyDataDefinition>) getToscaPresentationValue(JsonPresentationFields.GROUP_PROPERTIES);
+ }
+
+ public void setProperties(List<PropertyDataDefinition> properties) {
+ setToscaPresentationValue(JsonPresentationFields.GROUP_PROPERTIES, properties);
+ }
+
+ public String getTypeUid() {
+ return typeUid;
+ }
+
+ public void setTypeUid(String typeUid) {
+ this.typeUid = typeUid;
+ }
+
+ public boolean isUserDefined() {
+ return CreatedFrom.UI.equals(getCreatedFrom());
+ }
+
+ public boolean isVspOriginated() {
+ return CreatedFrom.CSAR.equals(getCreatedFrom());
+ }
+
+ @Override
+ public String toString() {
+ return "GroupDataDefinition [propertyValueCounter=" + propertyValueCounter + ", toscaPresentation=" + toscaPresentation + ", getName()=" + getName() + ", getUniqueId()=" + getUniqueId() + ", getType()=" + getType() + ", getVersion()="
+ + getVersion() + ", getInvariantUUID()=" + getInvariantUUID() + ", getDescription()=" + getDescription() + ", getPropertyValueCounter()=" + getPropertyValueCounter() + ", getGroupUUID()=" + getGroupUUID() + ", getMembers()="
+ + getMembers() + ", getArtifacts()=" + getArtifacts() + ", getArtifactsUuid()=" + getArtifactsUuid() + ", getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()="
+ + super.toString() + "]";
+ }
+
+
+ public boolean containsInstanceAsMember(String instanceId) {
+ return getMembers() != null && getMembers().values().contains(instanceId);
+ }
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinition.java
index 04cac38e47..69cca1e7be 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupInstanceDataDefinition.java
@@ -23,15 +23,12 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-public class GroupInstanceDataDefinition extends ToscaDataDefinition implements Serializable {
-
- private static final long serialVersionUID = -4231181556686542208L;
-
+public class GroupInstanceDataDefinition extends ToscaDataDefinition {
+
public GroupInstanceDataDefinition() {
super();
}
@@ -239,8 +236,4 @@ public class GroupInstanceDataDefinition extends ToscaDataDefinition implements
public void setProperties(List<PropertyDataDefinition> properties) {
setToscaPresentationValue(JsonPresentationFields.GROUP_INSTANCE_PROPERTIES, properties);
}
-
- public static long getSerialversionuid() {
- return serialVersionUID;
- }
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinition.java
index 18e594e0ce..a3bb8d4183 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GroupTypeDataDefinition.java
@@ -20,32 +20,18 @@
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
-import java.io.Serializable;
import java.util.List;
import java.util.Map;
-public class GroupTypeDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -7001817818907172496L;
+public class GroupTypeDataDefinition extends ToscaTypeDataDefinition {
private String uniqueId;
-
- private String type;
-
private String version;
-
private String derivedFrom;
-
private List<String> members;
-
private Map<String, String> metadata;
-
private String description;
+ private boolean highestVersion;
/**
* Timestamp of data type creation
@@ -57,30 +43,20 @@ public class GroupTypeDataDefinition extends ToscaDataDefinition implements Seri
*/
private Long modificationTime;
- private boolean highestVersion;
-
public GroupTypeDataDefinition() {
-
- }
-
- public GroupTypeDataDefinition(GroupTypeDataDefinition p) {
- this.uniqueId = p.uniqueId;
- this.type = p.type;
- this.version = p.version;
- this.members = p.members;
- this.metadata = p.metadata;
- // this.derivedFromName = p.derivedFromName;
- this.description = p.description;
- this.creationTime = p.creationTime;
- this.modificationTime = p.modificationTime;
- }
-
- public String getType() {
- return type;
}
- public void setType(String type) {
- this.type = type;
+ public GroupTypeDataDefinition(GroupTypeDataDefinition other) {
+ super(other);
+ this.uniqueId = other.uniqueId;
+ this.version = other.version;
+ this.members = other.members;
+ this.metadata = other.metadata;
+ this.description = other.description;
+ this.creationTime = other.creationTime;
+ this.modificationTime = other.modificationTime;
+ this.highestVersion = other.highestVersion;
+ this.derivedFrom = other.derivedFrom;
}
public String getVersion() {
@@ -141,7 +117,7 @@ public class GroupTypeDataDefinition extends ToscaDataDefinition implements Seri
@Override
public String toString() {
- return "GroupTypeDataDefinition [uniqueId=" + uniqueId + ", type=" + type + ", version=" + version
+ return "GroupTypeDataDefinition [uniqueId=" + uniqueId + ", type=" + getType() + ", name=" + getName() + ", icon=" + getIcon() + ", version=" + version
+ ", members=" + members + ", metadata=" + metadata + ", description=" + description + ", creationTime="
+ creationTime + ", modificationTime=" + modificationTime + "]";
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/HeatParameterDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/HeatParameterDataDefinition.java
index a2440610ae..4b5ed0c140 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/HeatParameterDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/HeatParameterDataDefinition.java
@@ -22,14 +22,7 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
-
-public class HeatParameterDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 8995421762148502848L;
+public class HeatParameterDataDefinition extends ToscaDataDefinition {
String uniqueId;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java
index 3406d85c82..c093d171a2 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java
@@ -22,12 +22,8 @@ package org.openecomp.sdc.be.datatypes.elements;
import java.util.Map;
-public class InputDataDefinition extends PropertyDataDefinition{
+public class InputDataDefinition extends PropertyDataDefinition {
- /**
- *
- */
- private static final long serialVersionUID = 8913646848974511031L;
String label;
Boolean hidden;
Boolean immutable;
@@ -38,21 +34,16 @@ public class InputDataDefinition extends PropertyDataDefinition{
public InputDataDefinition(Map<String, Object> pr) {
super(pr);
-
}
public InputDataDefinition(InputDataDefinition p) {
-
super(p);
this.setLabel(p.getLabel());
this.setHidden( p.isHidden());
this.setImmutable( p.isImmutable());
-
-
}
public InputDataDefinition(PropertyDataDefinition p) {
-
super(p);
}
@@ -79,5 +70,4 @@ public class InputDataDefinition extends PropertyDataDefinition{
public void setLabel(String label) {
this.label = label;
}
-
-}
+} \ No newline at end of file
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java
index 56f7103f8b..c0505c2b3d 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceDataDefinition.java
@@ -20,14 +20,15 @@
package org.openecomp.sdc.be.datatypes.elements;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME;
-
import com.fasterxml.jackson.annotation.JsonCreator;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+
+import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME;
public class InterfaceDataDefinition extends ToscaDataDefinition implements Serializable {
@@ -94,7 +95,7 @@ public class InterfaceDataDefinition extends ToscaDataDefinition implements Seri
public Map<String, OperationDataDefinition> getOperations() {
return (Map<String, OperationDataDefinition>)
- getToscaPresentationValue(JsonPresentationFields.INTERFACE_OPERATION);
+ getToscaPresentationValue(JsonPresentationFields.INTERFACE_OPERATION);
}
public void setOperations(Map<String, OperationDataDefinition> operations) {
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationDataDefinition.java
index 0283f4ca46..4607364f53 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationDataDefinition.java
@@ -17,18 +17,12 @@
package org.openecomp.sdc.be.datatypes.elements;
-import java.io.Serializable;
-
import com.fasterxml.jackson.annotation.JsonCreator;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.ARTIFACT_UUID;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.DESCRIPTION;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.UNIQUE_ID;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_INPUT_PARAMETERS;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_OPERATION_TYPE;
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_OUTPUT_PARAMETERS;
+import java.io.Serializable;
+
+import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.*;
public class InterfaceOperationDataDefinition extends ToscaDataDefinition implements Serializable {
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinition.java
index 09dc2a0597..0044ffaf60 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinition.java
@@ -16,11 +16,11 @@
package org.openecomp.sdc.be.datatypes.elements;
-import java.io.Serializable;
-
import com.fasterxml.jackson.annotation.JsonCreator;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+import java.io.Serializable;
+
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_PARAM_ID;
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_PARAM_NAME;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java
index ab886fa41f..073635a9f5 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java
@@ -24,32 +24,24 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;
import java.util.stream.Collectors;
-public class ListDataDefinition<T extends ToscaDataDefinition> extends ToscaDataDefinition implements Serializable {
+public class ListDataDefinition<T extends ToscaDataDefinition> extends ToscaDataDefinition {
protected List<T> listToscaDataDefinition;
public ListDataDefinition(ListDataDefinition<T> cdt) {
- super();
listToscaDataDefinition = cdt.listToscaDataDefinition;
}
public ListDataDefinition(List<T> listToscaDataDefinition) {
- super();
this.listToscaDataDefinition = listToscaDataDefinition;
}
@JsonCreator
public ListDataDefinition() {
- super();
this.listToscaDataDefinition = new ArrayList<>();
}
@@ -59,7 +51,7 @@ public class ListDataDefinition<T extends ToscaDataDefinition> extends ToscaData
public void add(T value) {
if (listToscaDataDefinition == null) {
- listToscaDataDefinition = new ArrayList<T>();
+ listToscaDataDefinition = new ArrayList<>();
}
listToscaDataDefinition.add(value);
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyProperty.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityProperty.java
index 5f22e6b401..39588524bf 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyProperty.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabilityProperty.java
@@ -26,12 +26,12 @@ import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Map;
-public class MapCapabiltyProperty extends MapDataDefinition<MapPropertiesDataDefinition> {
+public class MapCapabilityProperty extends MapDataDefinition<MapPropertiesDataDefinition> {
@JsonCreator
- public MapCapabiltyProperty(Map<String, MapPropertiesDataDefinition > mapToscaDataDefinition) {
+ public MapCapabilityProperty(Map<String, MapPropertiesDataDefinition > mapToscaDataDefinition) {
super(mapToscaDataDefinition);
}
- public MapCapabiltyProperty() {
+ public MapCapabilityProperty() {
super();
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java
index 0900f44cea..0bdb913035 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java
@@ -3,7 +3,6 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.*;
/**
@@ -13,13 +12,14 @@ import java.util.*;
* "workflows" -> { "ref1", "ref2" }
*
*/
-public class MapComponentInstanceExternalRefs extends ToscaDataDefinition implements Serializable {
+public class MapComponentInstanceExternalRefs extends ToscaDataDefinition {
- private static final long serialVersionUID = 7788408255736272985L;
-
- //Constructor
public MapComponentInstanceExternalRefs() {
- this.setComponentInstanceExternalRefs(new HashMap<String, List<String>>());
+ setComponentInstanceExternalRefs(new HashMap<>());
+ }
+
+ public MapComponentInstanceExternalRefs(Map<String, List<String>> instanceExternalReferences) {
+ setComponentInstanceExternalRefs(instanceExternalReferences);
}
public Map<String, List<String>> getComponentInstanceExternalRefs() {
@@ -27,8 +27,7 @@ public class MapComponentInstanceExternalRefs extends ToscaDataDefinition implem
}
public List<String> getExternalRefsByObjectType(String objectType) {
- List<String> externalRefsByObjectType = ((Map<String, List<String>>) getToscaPresentationValue(JsonPresentationFields.EXTERNAL_REF)).get(objectType);
- return externalRefsByObjectType;
+ return ((Map<String, List<String>>) getToscaPresentationValue(JsonPresentationFields.EXTERNAL_REF)).get(objectType);
}
public void setComponentInstanceExternalRefs(Map<String, List<String>> componentInstanceExternalRefs) {
@@ -47,7 +46,7 @@ public class MapComponentInstanceExternalRefs extends ToscaDataDefinition implem
if (refList == null) {
//Create list if does not exist and add it to map
- refList = new ArrayList<String>();
+ refList = new ArrayList<>();
this.getComponentInstanceExternalRefs().put(objectType, refList);
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java
index 66b51ed805..0d619ce1b4 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java
@@ -20,8 +20,6 @@
package org.openecomp.sdc.be.datatypes.elements;
-
-
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
@@ -56,7 +54,7 @@ public class MapDataDefinition <T extends ToscaDataDefinition> extends ToscaDa
public void put(String key, T value){
if(mapToscaDataDefinition == null){
- mapToscaDataDefinition = new HashMap<String, T>();
+ mapToscaDataDefinition = new HashMap<>();
}
mapToscaDataDefinition.put(key, value);
}
@@ -102,7 +100,6 @@ public class MapDataDefinition <T extends ToscaDataDefinition> extends ToscaDa
MapDataDefinition collectMap = new MapDataDefinition<>(collect);
mapToscaDataDefinition.entrySet().removeIf(e -> ownerIdList.contains(e.getValue().getOwnerId()));
-
return (T) collectMap;
}
return (T) new MapDataDefinition(new HashMap<>());
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinition.java
index f56b59934a..9f2e13ee78 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabilityDataDefinition.java
@@ -29,19 +29,19 @@ import com.fasterxml.jackson.annotation.JsonValue;
import java.util.HashMap;
import java.util.Map;
-public class MapListCapabiltyDataDefinition extends MapDataDefinition<ListCapabilityDataDefinition> {
+public class MapListCapabilityDataDefinition extends MapDataDefinition<ListCapabilityDataDefinition> {
- public MapListCapabiltyDataDefinition(MapListCapabiltyDataDefinition cdt) {
+ public MapListCapabilityDataDefinition(MapListCapabilityDataDefinition cdt) {
super(cdt);
}
@JsonCreator
- public MapListCapabiltyDataDefinition(Map<String, ListCapabilityDataDefinition> mapToscaDataDefinition) {
+ public MapListCapabilityDataDefinition(Map<String, ListCapabilityDataDefinition> mapToscaDataDefinition) {
super(mapToscaDataDefinition);
}
- public MapListCapabiltyDataDefinition() {
+ public MapListCapabilityDataDefinition() {
super();
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java
index dc99b7c320..5363cbbb2a 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java
@@ -21,10 +21,11 @@
package org.openecomp.sdc.be.datatypes.elements;
import com.fasterxml.jackson.annotation.JsonCreator;
-import java.io.Serializable;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+import java.io.Serializable;
+
public class OperationDataDefinition extends ToscaDataDefinition implements Serializable {
@@ -91,7 +92,7 @@ public class OperationDataDefinition extends ToscaDataDefinition implements Seri
public ListDataDefinition<OperationInputDefinition> getInputs() {
return (ListDataDefinition<OperationInputDefinition>)
- getToscaPresentationValue(JsonPresentationFields.OPERATION_INPUT);
+ getToscaPresentationValue(JsonPresentationFields.OPERATION_INPUT);
}
public void setInputs(ListDataDefinition<OperationInputDefinition> inputs) {
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinition.java
index fd34428855..1e0d5935da 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyDataDefinition.java
@@ -3,14 +3,15 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.List;
import java.util.Map;
+import static java.util.Collections.emptyList;
+
/**
* public class representing the component policy,
* described by the next properties:
- *
+ * <p>
* name
* uniqueId
* type (policy type name)
@@ -26,179 +27,184 @@ import java.util.Map;
* targets
* isFromCsar
*/
-public class PolicyDataDefinition extends ToscaDataDefinition implements Serializable{
-
- /**
- *
- */
- private static final long serialVersionUID = -4705371580363581255L;
-
- /**
- * public constructor by default
- */
- public PolicyDataDefinition() {
- super();
- }
-
- /**
- * public constructor from superclass
- * @param policy
- */
- public PolicyDataDefinition(Map<String, Object> policy) {
- super(policy);
- }
-
- /**
- * public copy constructor
- * @param other
- */
- public PolicyDataDefinition(PolicyDataDefinition other){
- this.setName(other.getName());
- this.setUniqueId(other.getUniqueId());
- this.setPolicyTypeName(other.getPolicyTypeName());
- this.setPolicyTypeUid(other.getPolicyTypeUid());
- this.setVersion(other.getVersion());
- this.setDerivedFrom(other.getDerivedFrom());
- this.setDescription(other.getDescription());
- this.setPolicyUUID(other.getPolicyUUID());
- this.setInvariantUUID(other.getInvariantUUID());
- this.setInvariantName(other.getInvariantName());
- this.setComponentName(other.getComponentName());
- this.setIsFromCsar(other.getIsFromCsar());
- if (other.getProperties() != null) {
- this.setProperties(other.getProperties());
- }
- if (other.getTargets() != null) {
- this.setTargets(other.getTargets());
- }
- }
-
- private void setIsFromCsar(Boolean isFromCsar) {
- if(isFromCsar == null){
- setToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR, false);
- } else {
- setToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR, isFromCsar);
- }
- }
-
- public Boolean getIsFromCsar() {
- Boolean isFromCsar = (Boolean) getToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR);
- return ( isFromCsar != null ) ? isFromCsar : false;
- }
-
- public String getComponentName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_NAME);
- }
-
- public void setComponentName(String componentName) {
- setToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_NAME, componentName);
- }
-
- public String getInvariantName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.CI_INVARIANT_NAME);
- }
-
- public void setInvariantName(Object invariantName) {
- setToscaPresentationValue(JsonPresentationFields.CI_INVARIANT_NAME, invariantName);
- }
-
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
- public String getUniqueId() {
- return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
- }
-
- public void setUniqueId(String uniqueId) {
- setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
- }
-
- public String getPolicyTypeName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
- }
-
- public void setPolicyTypeName(String policyTypeName) {
- setToscaPresentationValue(JsonPresentationFields.TYPE, policyTypeName);
- }
-
- public String getPolicyTypeUid() {
- return (String) getToscaPresentationValue(JsonPresentationFields.TYPE_UNIQUE_ID);
- }
-
- public void setPolicyTypeUid(String policyTypeUid) {
- setToscaPresentationValue(JsonPresentationFields.TYPE_UNIQUE_ID, policyTypeUid);
- }
-
- public String getVersion() {
- return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
- }
-
- public void setVersion(String version) {
- setToscaPresentationValue(JsonPresentationFields.VERSION, version);
- }
-
- public String getDerivedFrom() {
- return (String) getToscaPresentationValue(JsonPresentationFields.DERIVED_FROM);
- }
-
- public void setDerivedFrom(String derivedFrom) {
- setToscaPresentationValue(JsonPresentationFields.DERIVED_FROM, derivedFrom);
- }
-
- public String getDescription() {
- return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
- }
-
- public void setDescription(String description) {
- setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
- }
-
- public String getPolicyUUID() {
- return (String) getToscaPresentationValue(JsonPresentationFields.UUID);
- }
-
- public void setPolicyUUID(String policyUUID) {
- setToscaPresentationValue(JsonPresentationFields.UUID, policyUUID);
- }
- public String getInvariantUUID() {
- return (String) getToscaPresentationValue(JsonPresentationFields.INVARIANT_UUID);
- }
-
- public void setInvariantUUID(String invariantUUID) {
- setToscaPresentationValue(JsonPresentationFields.INVARIANT_UUID, invariantUUID);
- }
-
- @SuppressWarnings("unchecked")
- public List<PropertyDataDefinition> getProperties() {
- return (List<PropertyDataDefinition> ) getToscaPresentationValue(JsonPresentationFields.PROPERTIES);
- }
-
- public void setProperties(List<PropertyDataDefinition> properties) {
- setToscaPresentationValue(JsonPresentationFields.PROPERTIES, properties);
- }
-
- @SuppressWarnings("unchecked")
- public Map<PolicyTargetType, List<String>> getTargets() {
- return (Map<PolicyTargetType, List<String>>) getToscaPresentationValue(JsonPresentationFields.TARGETS);
- }
-
- public void setTargets(Map<PolicyTargetType, List<String>> metadata) {
- setToscaPresentationValue(JsonPresentationFields.TARGETS, metadata);
- }
-
- public List<String> resolveComponentInstanceTargets() {
- Map<PolicyTargetType, List<String>> targets = getTargets();
- return targets == null ? null: targets.get(PolicyTargetType.COMPONENT_INSTANCES);
- }
-
- public boolean containsCmptInstanceAsTarget(String cmptInstId) {
- List<String> componentInstanceTargets = resolveComponentInstanceTargets();
- return componentInstanceTargets != null && componentInstanceTargets.contains(cmptInstId);
- }
-
+public class PolicyDataDefinition extends ToscaDataDefinition {
+
+ /**
+ * public constructor by default
+ */
+ public PolicyDataDefinition() {
+ super();
+ }
+
+ /**
+ * public constructor from superclass
+ *
+ * @param policy
+ */
+ public PolicyDataDefinition(Map<String, Object> policy) {
+ super(policy);
+ }
+
+ /**
+ * public copy constructor
+ *
+ * @param other
+ */
+ public PolicyDataDefinition(PolicyDataDefinition other) {
+ this.setName(other.getName());
+ this.setUniqueId(other.getUniqueId());
+ this.setPolicyTypeName(other.getPolicyTypeName());
+ this.setPolicyTypeUid(other.getPolicyTypeUid());
+ this.setVersion(other.getVersion());
+ this.setDerivedFrom(other.getDerivedFrom());
+ this.setDescription(other.getDescription());
+ this.setPolicyUUID(other.getPolicyUUID());
+ this.setInvariantUUID(other.getInvariantUUID());
+ this.setInvariantName(other.getInvariantName());
+ this.setComponentName(other.getComponentName());
+ this.setIsFromCsar(other.getIsFromCsar());
+ if (other.getProperties() != null) {
+ this.setProperties(other.getProperties());
+ }
+ if (other.getTargets() != null) {
+ this.setTargets(other.getTargets());
+ }
+ }
+
+ private void setIsFromCsar(Boolean isFromCsar) {
+ if (isFromCsar == null) {
+ setToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR, false);
+ } else {
+ setToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR, isFromCsar);
+ }
+ }
+
+ public Boolean getIsFromCsar() {
+ Boolean isFromCsar = (Boolean) getToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR);
+ return (isFromCsar != null) ? isFromCsar : false;
+ }
+
+ public String getComponentName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_NAME);
+ }
+
+ public void setComponentName(String componentName) {
+ setToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_NAME, componentName);
+ }
+
+ public String getInvariantName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.CI_INVARIANT_NAME);
+ }
+
+ public void setInvariantName(Object invariantName) {
+ setToscaPresentationValue(JsonPresentationFields.CI_INVARIANT_NAME, invariantName);
+ }
+
+ public String getName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
+ }
+
+ public void setName(String name) {
+ setToscaPresentationValue(JsonPresentationFields.NAME, name);
+ }
+
+ public String getUniqueId() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
+ }
+
+ public void setUniqueId(String uniqueId) {
+ setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
+ }
+
+ public String getPolicyTypeName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
+ }
+
+ public void setPolicyTypeName(String policyTypeName) {
+ setToscaPresentationValue(JsonPresentationFields.TYPE, policyTypeName);
+ }
+
+ public String getPolicyTypeUid() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.TYPE_UNIQUE_ID);
+ }
+
+ public void setPolicyTypeUid(String policyTypeUid) {
+ setToscaPresentationValue(JsonPresentationFields.TYPE_UNIQUE_ID, policyTypeUid);
+ }
+
+ public String getVersion() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
+ }
+
+ public void setVersion(String version) {
+ setToscaPresentationValue(JsonPresentationFields.VERSION, version);
+ }
+
+ public String getDerivedFrom() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.DERIVED_FROM);
+ }
+
+ public void setDerivedFrom(String derivedFrom) {
+ setToscaPresentationValue(JsonPresentationFields.DERIVED_FROM, derivedFrom);
+ }
+
+ public String getDescription() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
+ }
+
+ public void setDescription(String description) {
+ setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
+ }
+
+ public String getPolicyUUID() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.UUID);
+ }
+
+ public void setPolicyUUID(String policyUUID) {
+ setToscaPresentationValue(JsonPresentationFields.UUID, policyUUID);
+ }
+
+ public String getInvariantUUID() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.INVARIANT_UUID);
+ }
+
+ public void setInvariantUUID(String invariantUUID) {
+ setToscaPresentationValue(JsonPresentationFields.INVARIANT_UUID, invariantUUID);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<PropertyDataDefinition> getProperties() {
+ return (List<PropertyDataDefinition>) getToscaPresentationValue(JsonPresentationFields.PROPERTIES);
+ }
+
+ public void setProperties(List<PropertyDataDefinition> properties) {
+ setToscaPresentationValue(JsonPresentationFields.PROPERTIES, properties);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map<PolicyTargetType, List<String>> getTargets() {
+ return (Map<PolicyTargetType, List<String>>) getToscaPresentationValue(JsonPresentationFields.TARGETS);
+ }
+
+ public void setTargets(Map<PolicyTargetType, List<String>> metadata) {
+ setToscaPresentationValue(JsonPresentationFields.TARGETS, metadata);
+ }
+
+ public List<String> resolveComponentInstanceTargets() {
+ return resolveTargetsByType(PolicyTargetType.COMPONENT_INSTANCES);
+ }
+
+ public List<String> resolveGroupTargets() {
+ return resolveTargetsByType(PolicyTargetType.GROUPS);
+ }
+
+ public boolean containsTarget(String targetId, PolicyTargetType policyTargetType) {
+ return resolveTargetsByType(policyTargetType).contains(targetId);
+ }
+
+ private List<String> resolveTargetsByType(PolicyTargetType targetType) {
+ Map<PolicyTargetType, List<String>> targets = getTargets();
+ return targets == null || !targets.containsKey(targetType) ? emptyList() : targets.get(targetType);
+ }
+
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinition.java
index 38cb4da1ca..b5c21e5e6d 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PolicyTypeDataDefinition.java
@@ -20,31 +20,16 @@
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
-import java.io.Serializable;
import java.util.List;
import java.util.Map;
-public class PolicyTypeDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -3783390539788578388L;
+public class PolicyTypeDataDefinition extends ToscaTypeDataDefinition {
private String uniqueId;
-
- private String type;
-
private String version;
-
private String derivedFrom;
-
private List<String> targets;
-
private Map<String, String> metadata;
-
private String description;
/**
@@ -56,16 +41,14 @@ public class PolicyTypeDataDefinition extends ToscaDataDefinition implements Ser
* Timestamp of the data type last update
*/
private Long modificationTime;
-
private boolean highestVersion;
public PolicyTypeDataDefinition() {
-
}
public PolicyTypeDataDefinition(PolicyTypeDataDefinition p) {
+ super(p);
this.uniqueId = p.uniqueId;
- this.type = p.type;
this.version = p.version;
this.targets = p.targets;
this.metadata = p.metadata;
@@ -76,14 +59,6 @@ public class PolicyTypeDataDefinition extends ToscaDataDefinition implements Ser
this.highestVersion = p.highestVersion;
}
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
public String getVersion() {
return version;
}
@@ -142,7 +117,7 @@ public class PolicyTypeDataDefinition extends ToscaDataDefinition implements Ser
@Override
public String toString() {
- return "PolicyTypeDataDefinition [uniqueId=" + uniqueId + ", type=" + type + ", version=" + version
+ return "PolicyTypeDataDefinition [uniqueId=" + uniqueId + ", type=" + getType() + ", name=" + getName() + ", icon=" + getIcon() + ", version=" + version
+ ", targets=" + targets + ", metadata=" + metadata + ", description=" + description + ", creationTime="
+ creationTime + ", modificationTime=" + modificationTime + "]";
}
@@ -162,5 +137,4 @@ public class PolicyTypeDataDefinition extends ToscaDataDefinition implements Ser
public void setHighestVersion(boolean isLatestVersion) {
this.highestVersion = isLatestVersion;
}
-
-}
+} \ No newline at end of file
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinition.java
index 62ae62edab..cb9316d6be 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ProductMetadataDataDefinition.java
@@ -22,16 +22,10 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-public class ProductMetadataDataDefinition extends ComponentMetadataDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -1877577227290771160L;
+public class ProductMetadataDataDefinition extends ComponentMetadataDataDefinition {
private String fullName;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
index 482933e399..c4a78433f5 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
@@ -23,16 +23,11 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
-public class PropertyDataDefinition extends ToscaDataDefinition implements Serializable {
+import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
- /**
- *
- */
- private static final long serialVersionUID = 5798685557528432389L;
+public class PropertyDataDefinition extends ToscaDataDefinition {
private String uniqueId;
@@ -64,6 +59,8 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
private String inputId;
private String instanceUniqueId;
private String propertyId;
+
+ private List<Annotation> annotations;
/**
* The resource id which this property belongs to
*/
@@ -97,12 +94,15 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
this.setImmutable(p.isImmutable());
this.setParentUniqueId(p.getParentUniqueId());
this.setOwnerId(p.getOwnerId());
- this.setGetInputValues(p.getInputValues);
+ this.setGetInputValues(p.getGetInputValues());
this.setInputPath(p.getInputPath());
this.setStatus(p.getStatus());
this.setInputId(p.getInputId());
this.setInstanceUniqueId(p.getInstanceUniqueId());
this.setPropertyId(p.getPropertyId());
+ if(isNotEmpty(p.annotations)){
+ this.setAnnotations(p.annotations);
+ }
}
public String getInputPath() {
@@ -200,6 +200,14 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
}
return null;
}
+
+ public PropertyDataDefinition getSchemaProperty() {
+ if (schema != null) {
+ return schema.getProperty();
+ }
+
+ return null;
+ }
public String getLabel() {
return label;
@@ -298,15 +306,19 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
}
public boolean typeEquals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
PropertyDataDefinition other = (PropertyDataDefinition) obj;
- if (this.getType() == null)
- return other.getType() == null;
+ if (this.getType() == null) {
+ return other.getType() == null;
+ }
if (!this.type.equals(other.type)) {
return false;
}
@@ -320,57 +332,78 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
@Override
public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
PropertyDataDefinition other = (PropertyDataDefinition) obj;
if (defaultValue == null) {
- if (other.defaultValue != null)
- return false;
- } else if (!defaultValue.equals(other.defaultValue))
- return false;
- if (definition != other.definition)
- return false;
+ if (other.defaultValue != null) {
+ return false;
+ }
+ } else if (!defaultValue.equals(other.defaultValue)) {
+ return false;
+ }
+ if (definition != other.definition) {
+ return false;
+ }
if (description == null) {
- if (other.description != null)
- return false;
- } else if (!description.equals(other.description))
- return false;
- if (password != other.password)
- return false;
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (password != other.password) {
+ return false;
+ }
if (required == null) {
- if (other.required != null)
- return false;
- } else if (!required.equals(other.required))
- return false;
+ if (other.required != null) {
+ return false;
+ }
+ } else if (!required.equals(other.required)) {
+ return false;
+ }
if (schema == null) {
- if (other.schema != null)
- return false;
- } else if (!schema.equals(other.schema))
- return false;
+ if (other.schema != null) {
+ return false;
+ }
+ } else if (!schema.equals(other.schema)) {
+ return false;
+ }
if (type == null) {
- if (other.type != null)
- return false;
- } else if (!type.equals(other.type))
- return false;
+ if (other.type != null) {
+ return false;
+ }
+ } else if (!type.equals(other.type)) {
+ return false;
+ }
if (parentUniqueId == null) {
- if (other.parentUniqueId != null)
- return false;
- } else if (!parentUniqueId.equals(other.parentUniqueId))
- return false;
+ if (other.parentUniqueId != null) {
+ return false;
+ }
+ } else if (!parentUniqueId.equals(other.parentUniqueId)) {
+ return false;
+ }
if (uniqueId == null) {
- if (other.uniqueId != null)
- return false;
- } else if (!uniqueId.equals(other.uniqueId))
- return false;
+ if (other.uniqueId != null) {
+ return false;
+ }
+ } else if (!uniqueId.equals(other.uniqueId)) {
+ return false;
+ }
if (status == null) {
- if (other.status != null)
- return false;
- } else if (!status.equals(other.status))
- return false;
+ if (other.status != null) {
+ return false;
+ }
+ } else if (!status.equals(other.status)) {
+ return false;
+ }
return true;
}
@@ -396,6 +429,36 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
}
}
+ @Override
+ public void setToscaPresentationValue(JsonPresentationFields name, Object value) {
+ switch (name) {
+ case NAME:
+ setName((String)value);
+ break;
+ case UNIQUE_ID:
+ setUniqueId((String)value);
+ break;
+ case PASSWORD:
+ setPassword((Boolean)value);
+ break;
+ case TYPE:
+ setType((String)value);
+ break;
+ case DEFINITION:
+ setDefinition((Boolean)value);
+ break;
+ case VALUE:
+ setValue((String)value);
+ break;
+ case DEFAULT_VALUE:
+ setDefaultValue((String)value);
+ break;
+ default:
+ super.setToscaPresentationValue(name, value);
+ break;
+ }
+ }
+
private <T extends ToscaDataDefinition> boolean compareSchemaType(T other) {
return !"list".equals(type) && !"map".equals(type) || this.getSchema().getProperty().getType().equals(((PropertyDataDefinition) other).getSchema().getProperty().getType());
}
@@ -406,10 +469,8 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
this.getType().equals(other.getToscaPresentationValue(JsonPresentationFields.TYPE)) &&
compareSchemaType(other)) {
other.setOwnerId(getOwnerId());
- if (allowDefaultValueOverride) {
- if (getDefaultValue() != null && !getDefaultValue().isEmpty()) {
- other.setToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE, getDefaultValue());
- }
+ if (allowDefaultValueOverride && getDefaultValue() != null && !getDefaultValue().isEmpty()) {
+ other.setToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE, getDefaultValue());
}
return other;
}
@@ -417,12 +478,29 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
}
public void convertPropertyDataToInstancePropertyData() {
- if (null != value)
- defaultValue = value;
+ if (null != value) {
+ defaultValue = value;
+ }
}
public boolean isGetInputProperty() {
return this.getGetInputValues() != null && !this.getGetInputValues().isEmpty();
}
+ public void setAnnotations(List<Annotation> newAnnotations) {
+ Set<Annotation> annotationSet = isNotEmpty(newAnnotations) ? new HashSet<>(newAnnotations) : new HashSet<>();
+ //We would to prioritize the new valid annotations over the old ones if the same one existed.
+ if(this.annotations != null){
+ for(Annotation oldInputAnnotation : this.annotations)
+ annotationSet.add(oldInputAnnotation);
+ }
+
+ this.annotations = new ArrayList<>(annotationSet);
+ setToscaPresentationValue(JsonPresentationFields.ANNOTATIONS, this.annotations);
+ }
+
+ public List<Annotation> getAnnotations() {
+ return (List<Annotation>) getToscaPresentationValue(JsonPresentationFields.ANNOTATIONS);
+ }
+
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyRule.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyRule.java
index d9f913e58b..ee39401391 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyRule.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyRule.java
@@ -23,15 +23,9 @@ package org.openecomp.sdc.be.datatypes.elements;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.List;
-public class PropertyRule extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -3357933382124599996L;
+public class PropertyRule extends ToscaDataDefinition {
public final static String FORCE_ALL = "FORCE_ALL";
public final static String ALL = "ALL";
@@ -114,7 +108,7 @@ public class PropertyRule extends ToscaDataDefinition implements Serializable {
for (int i = 0; i < size; i++) {
String item = rule.get(i);
String comparedItem = comparedRule.get(i);
- if (item == null || false == item.equals(comparedItem)) {
+ if (item == null || !item.equals(comparedItem)) {
isEqual = false;
break;
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java
index f1fe93f6ba..72d9c36bf6 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java
@@ -23,23 +23,17 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.List;
-public class RelationshipInstDataDefinition extends ToscaDataDefinition implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 1104043358598884458L;
+public class RelationshipInstDataDefinition extends ToscaDataDefinition {
public RelationshipInstDataDefinition(RelationshipInstDataDefinition cdt) {
- super();
this.setUniqueId(cdt.getUniqueId());
this.setDescription(cdt.getDescription());
this.setType(cdt.getType());
this.setValidSourceTypes(cdt.getValidSourceTypes());
this.setVersion(cdt.getVersion());
+ this.setOriginUI(cdt.isOriginUI());
this.setCreationTime(cdt.getCreationTime());
this.setModificationTime(cdt.getModificationTime());
this.setCapabilityOwnerId(cdt.getCapabilityOwnerId());
@@ -50,7 +44,6 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition implemen
this.setToId(cdt.getToId());
this.setRequirement(cdt.getRequirement());
this.setCapability(cdt.getCapability());
-
}
public void setRequirement(String requirement) {
@@ -158,6 +151,14 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition implemen
public void setVersion(String version) {
setToscaPresentationValue(JsonPresentationFields.VERSION, version);
}
+
+ public Boolean isOriginUI() {
+ return (Boolean) getToscaPresentationValue(JsonPresentationFields.ORIGIN_UI);
+ }
+
+ public void setOriginUI(Boolean originUI) {
+ setToscaPresentationValue(JsonPresentationFields.ORIGIN_UI, originUI);
+ }
public Long getCreationTime() {
return (Long) getToscaPresentationValue(JsonPresentationFields.CREATION_TIME);
@@ -183,11 +184,12 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition implemen
String type = getType();
List<String> validSourceTypes = getValidSourceTypes();
String version = getVersion();
+ Boolean originUI = isOriginUI();
Long creationTime = getCreationTime();
Long modificationTime = getModificationTime();
- return "RelationshipTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type + ", validSourceTypes=" + validSourceTypes + ", version=" + version + ", creationTime=" + creationTime + ", modificationTime="
- + modificationTime + "]";
+ return "RelationshipTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type + ", validSourceTypes=" + validSourceTypes +
+ ", version=" + version + ", originUI=" + originUI + ", creationTime=" + creationTime + ", modificationTime=" + modificationTime + "]";
}
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java
index 42b828634d..4ede93eaa6 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java
@@ -24,26 +24,21 @@ import com.google.common.collect.Lists;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* Represents the requirement of the component or component instance
*/
-public class RequirementDataDefinition extends ToscaDataDefinition implements Serializable {
- /**
- *
- */
+public class RequirementDataDefinition extends ToscaDataDefinition {
+
public static final String MIN_OCCURRENCES = "1";
public static final String MAX_OCCURRENCES = "UNBOUNDED";
public static final String MAX_DEFAULT_OCCURRENCES = "1";
- private static final long serialVersionUID = -8840549489409274532L;
/**
* The default constructor initializing limits of the occurrences
*/
public RequirementDataDefinition() {
- super();
this.setMinOccurrences( MIN_OCCURRENCES );
this.setMaxOccurrences( MAX_OCCURRENCES);
this.setLeftOccurrences( MAX_OCCURRENCES);
@@ -56,6 +51,7 @@ public class RequirementDataDefinition extends ToscaDataDefinition implements Se
this.setUniqueId(other.getUniqueId());
this.setName(other.getName());
this.setParentName(other.getParentName());
+ this.setPreviousName(other.getPreviousName());
this.setCapability(other.getCapability());
this.setNode(other.getNode());
this.setRelationship(other.getRelationship());
@@ -98,6 +94,14 @@ public class RequirementDataDefinition extends ToscaDataDefinition implements Se
setToscaPresentationValue(JsonPresentationFields.PARENT_NAME, parentName);
}
+ public String getPreviousName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.PREVIOUS_NAME);
+ }
+
+ public void setPreviousName(String previousName) {
+ setToscaPresentationValue(JsonPresentationFields.PREVIOUS_NAME, previousName);
+ }
+
/**
* specify the capability type
*/
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinition.java
index e6c1469233..57fe56412c 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/SchemaDefinition.java
@@ -22,21 +22,14 @@ package org.openecomp.sdc.be.datatypes.elements;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Schema allows to create new types that can be used along TOSCA definitions.
*/
-public class SchemaDefinition extends ToscaDataDefinition implements Serializable {
+public class SchemaDefinition extends ToscaDataDefinition {
- /**
- *
- */
- private static final long serialVersionUID = 7117891081909380577L;
-
private String derivedFrom;
private List<String> constraints;
private Map<String, PropertyDataDefinition> properties;
@@ -46,14 +39,10 @@ public class SchemaDefinition extends ToscaDataDefinition implements Serializabl
public SchemaDefinition() {
- super();
- properties = new HashMap<>();
}
public SchemaDefinition(String derivedFrom, List<String> constraints,
Map<String, PropertyDataDefinition> properties) {
- super();
-
this.setDerivedFrom(derivedFrom);
this.setConstraints( constraints);
this.setProperties( properties);
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaTypeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaTypeDataDefinition.java
new file mode 100644
index 0000000000..78b047782a
--- /dev/null
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaTypeDataDefinition.java
@@ -0,0 +1,43 @@
+package org.openecomp.sdc.be.datatypes.elements;
+
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+
+public class ToscaTypeDataDefinition extends ToscaDataDefinition {
+
+ private String name;
+ private String icon;
+ private String type;
+
+ ToscaTypeDataDefinition() {
+ }
+
+ ToscaTypeDataDefinition(ToscaTypeDataDefinition other) {
+ this.name = other.getName();
+ this.icon = other.icon;
+ this.type = other.type;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+}