summaryrefslogtreecommitdiffstats
path: root/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/common/blueprint/BlueprintHelper.java
diff options
context:
space:
mode:
authorTomasz Wrobel <tomasz.wrobel@nokia.com>2020-09-22 15:19:03 +0200
committerTomasz Wrobel <tomasz.wrobel@nokia.com>2020-09-24 11:51:07 +0200
commitb9cb00657207bb020c1802485c930b46621d4813 (patch)
treee62c4603116ea79f5974859fd4455aa108b36b62 /mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/common/blueprint/BlueprintHelper.java
parent9e72a68a16d4a7aaeb093e23e288585f9aebd220 (diff)
Refactor, fix code formatting and add unittests
-Refactor DmaapNode class -Add UT for DmaapNode -Refactor and fix code formatting in DmaapStreem class -Top up version to 1.5.2 Issue-ID: DCAEGEN2-2449 Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com> Change-Id: If6781f26bb6bfe2a645b0b0438157823670341a2
Diffstat (limited to 'mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/common/blueprint/BlueprintHelper.java')
-rw-r--r--mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/common/blueprint/BlueprintHelper.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/common/blueprint/BlueprintHelper.java b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/common/blueprint/BlueprintHelper.java
index 451988f..ef335a8 100644
--- a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/common/blueprint/BlueprintHelper.java
+++ b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/common/blueprint/BlueprintHelper.java
@@ -27,6 +27,9 @@ import java.util.LinkedHashMap;
@UtilityClass
public class BlueprintHelper {
+ public static final String INTEGER_TYPE = "integer";
+ public static final String BOOLEAN_TYPE = "boolean";
+
public static LinkedHashMap<String, Object> createInputValue(String type, String description, Object defaultValue) {
LinkedHashMap<String, Object> inputMap = new LinkedHashMap<>();
inputMap.put("type", type);
@@ -35,7 +38,23 @@ public class BlueprintHelper {
return inputMap;
}
+ public static LinkedHashMap<String, Object> createIntegerInput(String description, Object defaultValue){
+ return createInputValue(INTEGER_TYPE, description, defaultValue);
+ }
+
+ public static LinkedHashMap<String, Object> createBooleanInput(String description, Object defaultValue){
+ return createInputValue(BOOLEAN_TYPE, description, defaultValue);
+ }
+
public static String joinUnderscore(String firstValue, String secondValue){
return firstValue + "_" + secondValue;
}
+
+ public static boolean isDataRouterType(String type) {
+ return type.equals("data_router") || type.equals("data router");
+ }
+
+ public static boolean isMessageRouterType(String type) {
+ return type.equals("message_router") || type.equals("message router");
+ }
}