diff options
Diffstat (limited to 'jython-tosca-parser/src/main/java/org/openecomp')
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(); } |