From dd2b7b8ef7a694a82e52ea31bd44e89618ac6b8a Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Fri, 9 Mar 2018 07:42:24 +0530 Subject: Make bool param set by string value Issue-ID: CLI-99 Change-Id: I3778e848dc824c1a7145a0fcf8cb3e4b7af695ab Signed-off-by: Kanagaraj Manickam k00365106 --- .../src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java b/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java index 31897850..8cc7b454 100644 --- a/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java +++ b/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java @@ -292,7 +292,12 @@ public class OnapCommandParameter { } } else if (OnapCommandParameterType.BOOL.equals(parameterType)) { if (!(value instanceof Boolean)) { - throw new OnapCommandInvalidParameterValue(this.getName()); + if (value instanceof String) { + value = Boolean.valueOf((String)value); + } else { + throw new OnapCommandInvalidParameterValue(this.getName()); + } + } } this.value = value; -- cgit 1.2.3-korg