aboutsummaryrefslogtreecommitdiffstats
path: root/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java
diff options
context:
space:
mode:
Diffstat (limited to 'jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java')
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java16
1 files changed, 14 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 526a0e3..30de2a8 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
@@ -2,12 +2,15 @@ package org.openecomp.sdc.toscaparser.api;
import static com.google.common.collect.ImmutableList.toImmutableList;
+import java.util.ArrayList;
import java.util.List;
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.JySubstitutionMappings;
+import org.openecomp.sdc.toscaparser.jython.parameters.JyInput;
import com.google.common.base.MoreObjects;
@@ -25,12 +28,21 @@ public class SubstitutionMappings {
.map(NodeTemplate::new)
.collect(toImmutableList());
}
+
+ public List<Group> getGroups() {
+ List<JyGroup> jyGroups = jySubstitutionMappings.getJyGroups();
+ return jyGroups != null ? jyGroups
+ .stream()
+ .map(Group::new)
+ .collect(toImmutableList()) : new ArrayList<>();
+ }
public List<Input> getInputs() {
- return jySubstitutionMappings.getJyInputs()
+ List<JyInput> jyInputs = jySubstitutionMappings.getJyInputs();
+ return jyInputs != null ? jyInputs
.stream()
.map(Input::new)
- .collect(toImmutableList());
+ .collect(toImmutableList()) : new ArrayList<>();
}
public NodeType getNodeDefinition() {