Support TOSCA functions in Node Filters
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / ArtifactDataDefinition.java
index 4eee042..54ab3bd 100644 (file)
@@ -369,6 +369,15 @@ public class ArtifactDataDefinition extends ToscaDataDefinition {
     public List<PropertyDataDefinition> getProperties() {
         return (List<PropertyDataDefinition>) getToscaPresentationValue(JsonPresentationFields.PROPERTIES);
     }
+    
+    public void addProperty(final PropertyDataDefinition property) {
+        List<PropertyDataDefinition> properties =  (List<PropertyDataDefinition>) getToscaPresentationValue(JsonPresentationFields.PROPERTIES);
+        if (properties == null) {
+            properties = new ArrayList<>();
+            setProperties(properties);
+        }
+        properties.add(property);
+    }
 
     private void setProperties(final List<PropertyDataDefinition> properties) {
         setToscaPresentationValue(JsonPresentationFields.PROPERTIES, properties);
@@ -468,6 +477,13 @@ public class ArtifactDataDefinition extends ToscaDataDefinition {
         } else if (!getArtifactRepository().equals(other.getArtifactRepository())) {
             return false;
         }
+        if (getArtifactName() == null) {
+            if (other.getArtifactName() != null) {
+                return false;
+            }
+        } else if (!getArtifactName().equals(other.getArtifactName())) {
+            return false;
+        }
         if (getArtifactType() == null) {
             if (other.getArtifactType() != null) {
                 return false;