aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorManzon, Inna (im453s) <im453s@intl.att.com>2018-11-29 17:26:34 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2018-12-02 13:03:39 +0000
commit789fe97ea2b934329b2b26323d7e5ffc44cf196f (patch)
tree68b00039eb95a115552dd5826a4635608dec9564 /src/main
parent71ee175c85dba54b9645978a38e767ba4fb5bf70 (diff)
SDC Tosca Parser getEntity API1.4.8
Change-Id: Ifc007335ef57904305458f63b422f2db41a3e694 Issue-ID: SDC-1967 Signed-off-by: Manzon, Inna (im453s) <im453s@intl.att.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/sdc/toscaparser/api/Policy.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/org/onap/sdc/toscaparser/api/Policy.java b/src/main/java/org/onap/sdc/toscaparser/api/Policy.java
index aeed368..9eaacfc 100644
--- a/src/main/java/org/onap/sdc/toscaparser/api/Policy.java
+++ b/src/main/java/org/onap/sdc/toscaparser/api/Policy.java
@@ -6,6 +6,7 @@ import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder;
import org.onap.sdc.toscaparser.api.utils.ValidateUtils;
@@ -20,8 +21,9 @@ public class Policy extends EntityTemplate {
private static final String TRIGGERS = "triggers";
private static final String SECTIONS[] = {
TYPE, METADATA, DESCRIPTION, PROPERTIES, TARGETS, TRIGGERS};
-
- LinkedHashMap<String,Object> metaData;
+
+// LinkedHashMap<String,Object> metaData;
+ Metadata metaData;
ArrayList<Object> targetsList; // *** a list of NodeTemplate OR a list of Group ***
String targetsType;
ArrayList<Object> triggers;
@@ -35,10 +37,10 @@ public class Policy extends EntityTemplate {
LinkedHashMap<String,Object> _customDef) {
super(_name,_policy,"policy_type",_customDef);
- metaData = null;
if(_policy.get(METADATA) != null) {
- metaData = (LinkedHashMap<String,Object>)_policy.get(METADATA);
- ValidateUtils.validateMap(metaData);
+ LinkedHashMap<String,Object> metadataMap = (LinkedHashMap<String,Object>)_policy.get(METADATA);
+ ValidateUtils.validateMap(metadataMap);
+ metaData = new Metadata(metadataMap);
}
targetsList = targetObjects;
@@ -67,10 +69,14 @@ public class Policy extends EntityTemplate {
return targetsType;
}
- public LinkedHashMap<String, Object> getMetaData() {
+ public Metadata getMetaDataObj() {
return metaData;
}
+ public LinkedHashMap<String, Object> getMetaData() {
+ return (LinkedHashMap)metaData.getAllProperties();
+ }
+
// public ArrayList<NodeTemplate> getTargetsList() {
public ArrayList<Object> getTargetsList() {
return targetsList;