aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/main
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-02-26 07:07:32 +0000
committerGerrit Code Review <gerrit@onap.org>2018-02-26 07:07:32 +0000
commit0e8dbede217edecaab527d6a84d010a685014b56 (patch)
tree8294869d36172c3c2e626a88061dbce16d97acce /asdc-controller/src/main
parent77d45601074f4026e45d6b07f7e49498a89c711c (diff)
parentbb9cc6b851572a3b756f65738034e546bd33e17d (diff)
Merge "Swap while loops with foreach where applicable"
Diffstat (limited to 'asdc-controller/src/main')
-rw-r--r--asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java33
1 files changed, 15 insertions, 18 deletions
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java
index f94e0a153b..a90fdeb8e6 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java
@@ -82,12 +82,10 @@ public class YamlEditor {
@SuppressWarnings("unchecked")
Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("resources");
- Iterator <Entry <String, Object>> it = resourceMap.entrySet ().iterator ();
- while (it.hasNext ()) {
- Map.Entry <String, Object> pair = it.next ();
+ for (Entry<String, Object> pair : resourceMap.entrySet()) {
@SuppressWarnings("unchecked")
- Map <String, String> resourceEntry = (Map <String, String>) pair.getValue ();
- typeList.add (resourceEntry.get ("type"));
+ Map<String, String> resourceEntry = (Map<String, String>) pair.getValue();
+ typeList.add(resourceEntry.get("type"));
}
return typeList;
}
@@ -100,28 +98,27 @@ public class YamlEditor {
Set <HeatTemplateParam> paramSet = new HashSet <HeatTemplateParam> ();
@SuppressWarnings("unchecked")
Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("parameters");
- Iterator <Entry <String, Object>> it = resourceMap.entrySet ().iterator ();
- while (it.hasNext ()) {
- HeatTemplateParam param = new HeatTemplateParam ();
- Map.Entry <String, Object> pair = it.next ();
+ for (Entry<String, Object> stringObjectEntry : resourceMap.entrySet()) {
+ HeatTemplateParam param = new HeatTemplateParam();
+ Entry<String, Object> pair = stringObjectEntry;
@SuppressWarnings("unchecked")
- Map <String, String> resourceEntry = (Map <String, String>) pair.getValue ();
-
- param.setParamName (pair.getKey ());
+ Map<String, String> resourceEntry = (Map<String, String>) pair.getValue();
+
+ param.setParamName(pair.getKey());
// System.out.println(pair.getKey()+":"+type);
if (resourceEntry.containsKey("default")) {
- param.setRequired (false);
+ param.setRequired(false);
} else {
- param.setRequired (true);
+ param.setRequired(true);
}
// Now set the type
- String value = resourceEntry.get ("type");
- param.setParamType (value);
-
+ String value = resourceEntry.get("type");
+ param.setParamType(value);
+
param.setHeatTemplateArtifactUuid(artifactUUID);
- paramSet.add (param);
+ paramSet.add(param);
}
return paramSet;