diff options
author | 2021-01-26 13:27:57 +0100 | |
---|---|---|
committer | 2021-01-27 09:18:53 +0100 | |
commit | 5cfbc4a1f1187eb330f5e88b3d9965d5732b5581 (patch) | |
tree | 56f0a00369ef54d564107a4df458aaf9c6fb18e0 /mod/bpgenerator/common/src/main/java | |
parent | 12bf7f388e919df51f869b5449f23a082082394d (diff) |
Bp-generator, fix app-config inputs in different types
Issue-ID: DCAEGEN2-1179
Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com>
Change-Id: I0a368f47e0737d8870144de8ab25a385e922f2a3
Diffstat (limited to 'mod/bpgenerator/common/src/main/java')
-rw-r--r-- | mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java index c9759d0..0526f48 100644 --- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java +++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java @@ -32,8 +32,8 @@ import java.util.LinkedHashMap; /** * @author : Ravi Mantena - * @date 10/16/2020 Application: DCAE/ONAP - Blueprint Generator Common Module: Used by both ONAp - * and DCAE Blueprint Applications Service: An interface for Common Functions used across Blueprint + * @date 10/16/2020 Application: DCAE/ONAP - Blueprint Generator Common Module: Used by both ONAp and DCAE Blueprint + * Applications Service: An interface for Common Functions used across Blueprint */ @Service public class BlueprintHelperService { @@ -41,8 +41,8 @@ public class BlueprintHelperService { /** * creates Input value by contatinating Type, Description and Default value * - * @param type Input Type - * @param description Description + * @param type Input Type + * @param description Description * @param defaultValue Default value of Type * @return */ @@ -58,7 +58,7 @@ public class BlueprintHelperService { /** * creates Input value by contatinating Type and Description * - * @param type Input Type + * @param type Input Type * @param description Description * @return */ @@ -72,7 +72,7 @@ public class BlueprintHelperService { /** * creates Input value by contatinating Type and Default value * - * @param type Input Type + * @param type Input Type * @param defaultValue Default value of Type * @return */ @@ -86,7 +86,7 @@ public class BlueprintHelperService { /** * creates Input value by contatinating Description and Default value * - * @param description Description + * @param description Description * @param defaultValue Default value of Type * @return */ @@ -118,7 +118,7 @@ public class BlueprintHelperService { /** * creates Integer Input value for given Description and Default value * - * @param description Description + * @param description Description * @param defaultValue Default value of Type * @return */ @@ -149,7 +149,8 @@ public class BlueprintHelperService { /** * creates String Input value for given Default value - * @param description Description + * + * @param description Description * @param defaultValue Default value of Type * @return */ @@ -173,9 +174,30 @@ public class BlueprintHelperService { } /** + * creates proper Input for given inputType and defaultValue. + * <p> + * Default input type: "string". + * + * @param inputType Input type, supported: "boolean", "integer" + * @param defaultValue Default value of Type + * @return + */ + public LinkedHashMap<String, Object> createInputByType(String inputType, Object defaultValue) { + switch (inputType) { + case "boolean": + return createBooleanInput(defaultValue); + case "integer": + return createIntegerInput(defaultValue); + default: + return createStringInput(defaultValue); + } + } + + + /** * Concatenates String Input values with Underscore * - * @param firstValue Value + * @param firstValue Value * @param secondValue Value * @return */ |