diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2018-03-09 07:42:24 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2018-03-09 07:42:24 +0530 |
commit | dd2b7b8ef7a694a82e52ea31bd44e89618ac6b8a (patch) | |
tree | 605952a1db93635e2c452972864212084efe1735 /framework/src/main/java | |
parent | 47c1f1f559e4c69fff6a91d2445e837f54da3a1f (diff) |
Make bool param set by string value
Issue-ID: CLI-99
Change-Id: I3778e848dc824c1a7145a0fcf8cb3e4b7af695ab
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src/main/java')
-rw-r--r-- | framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java | 7 |
1 files changed, 6 insertions, 1 deletions
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; |