summaryrefslogtreecommitdiffstats
path: root/jython-tosca-parser/src/main/java/org/openecomp
diff options
context:
space:
mode:
authorPavel Aharoni <pa0916@att.com>2017-04-10 10:15:41 +0300
committerPavel Aharoni <pa0916@att.com>2017-04-10 10:16:27 +0300
commit429b875ade17cf4fbd5d6fb9a9ff8e4abe34973e (patch)
treec78a10d97814889a3bc0e2adb09e984ed21a91da /jython-tosca-parser/src/main/java/org/openecomp
parent5fedaea41630b553c68b60a6442e703f11ea12f3 (diff)
[SDC-8] extended FDNT CSAR fix
Change-Id: Ic58b4b8a32acf9b6acfde8ecc9e7b8eb32403d7c Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'jython-tosca-parser/src/main/java/org/openecomp')
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java11
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JySubstitutionMappings.java2
2 files changed, 11 insertions, 2 deletions
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java
index 30de2a8..e962a4a 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java
@@ -9,6 +9,7 @@ import java.util.Objects;
import org.openecomp.sdc.toscaparser.api.elements.NodeType;
import org.openecomp.sdc.toscaparser.api.parameters.Input;
import org.openecomp.sdc.toscaparser.jython.JyGroup;
+import org.openecomp.sdc.toscaparser.jython.JyNodeTemplate;
import org.openecomp.sdc.toscaparser.jython.JySubstitutionMappings;
import org.openecomp.sdc.toscaparser.jython.parameters.JyInput;
@@ -23,10 +24,11 @@ public class SubstitutionMappings {
}
public List<NodeTemplate> getNodeTemplates() {
- return jySubstitutionMappings.getJyNodeTemplates()
+ List<JyNodeTemplate> jyNodeTemplates = jySubstitutionMappings.getJyNodeTemplates();
+ return jyNodeTemplates != null ? jyNodeTemplates
.stream()
.map(NodeTemplate::new)
- .collect(toImmutableList());
+ .collect(toImmutableList()) : new ArrayList<>();
}
public List<Group> getGroups() {
@@ -49,12 +51,17 @@ public class SubstitutionMappings {
return new NodeType(jySubstitutionMappings.getJyNodeDefinition());
}
+ public Metadata getMetadata(){
+ return jySubstitutionMappings.getJyMetadata() != null ? new Metadata(jySubstitutionMappings.getJyMetadata()) : null;
+ }
+
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("nodeTemplates", getNodeTemplates())
.add("inputs", getInputs())
.add("nodeDefinition", getNodeDefinition())
+ .add("metadata", getMetadata())
.toString();
}
}
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JySubstitutionMappings.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JySubstitutionMappings.java
index 1130e8c..537aa89 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JySubstitutionMappings.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JySubstitutionMappings.java
@@ -1,6 +1,7 @@
package org.openecomp.sdc.toscaparser.jython;
import java.util.List;
+import java.util.Map;
import org.openecomp.sdc.toscaparser.jython.elements.JyNodeType;
import org.openecomp.sdc.toscaparser.jython.parameters.JyInput;
@@ -11,4 +12,5 @@ public interface JySubstitutionMappings {
List<JyInput> getJyInputs();
List<JyGroup> getJyGroups();
JyNodeType getJyNodeDefinition();
+ Map<String, Object> getJyMetadata();
}