aboutsummaryrefslogtreecommitdiffstats
path: root/jython-tosca-parser/src/main/java/org/openecomp
diff options
context:
space:
mode:
authorPavel Aharoni <pa0916@att.com>2017-03-29 18:56:08 +0300
committerPavel Aharoni <pa0916@att.com>2017-03-29 18:56:43 +0300
commit905dce200dd3cf37bfc3b444a0d70b57232a30dc (patch)
tree3e4aad46e17d6daec871568fea3459a45c0034ec /jython-tosca-parser/src/main/java/org/openecomp
parent611df70a00b75c1107b858e6904dc402d3fdff17 (diff)
[SDC-7] jython tosca parser 0.4.0-SNAPSHOT
Change-Id: I838b10721cfdf5b714e14f56fdae4c3c6d51445b 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/NodeTemplate.java17
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java6
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyNodeTemplate.java3
-rw-r--r--jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyTopologyTemplate.java2
4 files changed, 28 insertions, 0 deletions
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/NodeTemplate.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/NodeTemplate.java
index 047a421..d8cac9e 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/NodeTemplate.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/NodeTemplate.java
@@ -1,10 +1,27 @@
package org.openecomp.sdc.toscaparser.api;
+import java.util.Map;
+
import org.openecomp.sdc.toscaparser.jython.JyNodeTemplate;
+import com.google.common.base.MoreObjects.ToStringHelper;
+
public class NodeTemplate extends EntityTemplate {
+ private final JyNodeTemplate jyNodeTemplate;
+
public NodeTemplate(JyNodeTemplate jyNodeTemplate) {
super(jyNodeTemplate);
+ this.jyNodeTemplate = jyNodeTemplate;
+ }
+
+ public Map<String, String> getMetadata() {
+ return jyNodeTemplate.getJyMetadata();
}
+
+ @Override
+ protected ToStringHelper toStringHelper() {
+ return super.toStringHelper()
+ .add("metadata", getMetadata());
+ }
}
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java
index 1769455..5c9db48 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java
@@ -3,6 +3,7 @@ package org.openecomp.sdc.toscaparser.api;
import static com.google.common.collect.ImmutableList.toImmutableList;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import org.openecomp.sdc.toscaparser.api.parameters.Input;
@@ -48,6 +49,10 @@ public class TopologyTemplate {
JySubstitutionMappings jySubstitutionMappings = jyTopologyTemplate.getJySubstitutionMappings();
return jySubstitutionMappings != null ? new SubstitutionMappings(jySubstitutionMappings) : null;
}
+
+ public Map<String, String> getMetadata() {
+ return jyTopologyTemplate.getJyMetadata();
+ }
@Override
public String toString() {
@@ -57,6 +62,7 @@ public class TopologyTemplate {
.add("nodeTemplates", getNodeTemplates())
.add("groups", getGroups())
.add("substitutionMappings", getSubstitutionMappings())
+ .add("metadata", getMetadata())
.toString();
}
}
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyNodeTemplate.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyNodeTemplate.java
index b04a337..a837137 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyNodeTemplate.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyNodeTemplate.java
@@ -1,5 +1,8 @@
package org.openecomp.sdc.toscaparser.jython;
+import java.util.Map;
+
public interface JyNodeTemplate extends JyEntityTemplate {
+ Map<String, String> getJyMetadata();
}
diff --git a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyTopologyTemplate.java b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyTopologyTemplate.java
index c6fe053..9cdc38b 100644
--- a/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyTopologyTemplate.java
+++ b/jython-tosca-parser/src/main/java/org/openecomp/sdc/toscaparser/jython/JyTopologyTemplate.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.parameters.JyInput;
@@ -11,4 +12,5 @@ public interface JyTopologyTemplate {
List<JyInput> getJyInputs();
List<JyGroup> getJyGroups();
JySubstitutionMappings getJySubstitutionMappings();
+ Map<String, String> getJyMetadata();
}