diff options
author | Dhrumin Desai <dd303q@att.com> | 2020-03-03 17:56:23 -0500 |
---|---|---|
committer | Dhrumin Desai <dd303q@att.com> | 2020-03-04 10:56:11 -0500 |
commit | 8a5d7e7d26429598aa14c1ffc5d9dec85e1ff522 (patch) | |
tree | 76423890a43595cd57cd9b16b75e7eb76e9234df /mod | |
parent | afae73ea4d0071e150d85350dc6dc4b6dec6f381 (diff) |
fixed input string type issue in bp_gen
Issue-ID: DCAEGEN2-2120
Change-Id: I95f6c3093377921250adf7089eca96f38b838f93
Signed-off-by: Dhrumin Desai <dd303q@att.com>
Diffstat (limited to 'mod')
-rw-r--r-- | mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Blueprint.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Blueprint.java b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Blueprint.java index 7ba4d22..c043a9e 100644 --- a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Blueprint.java +++ b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Blueprint.java @@ -80,20 +80,21 @@ public class Blueprint { } return bp; } + public Blueprint setQuotations(Blueprint bp) { for(String s: bp.getInputs().keySet()) { LinkedHashMap<String, Object> temp = bp.getInputs().get(s); if(temp.get("type") == "string") { String def = (String) temp.get("default"); - if(def != null && def.equals("")){ - String emptyString = "\"\""; - Object emptyObj = emptyString; - temp.put("default", emptyObj); + if(def != null){ + def = def.replaceAll("\"$", "").replaceAll("^\"", ""); } + def = '"' + def + '"'; + temp.replace("default", def); bp.getInputs().replace(s, temp); } } - + return bp; } |