diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2018-04-26 16:16:51 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2018-04-26 16:19:31 +0530 |
commit | 49726ae09818a3dea2f9c7442b8430ba78193bf4 (patch) | |
tree | d75d812bc3faad8a1f9983e09e1f4dc44567db0b /framework/src/main | |
parent | f47b073b44464e293e647f30516dce6e29819dea (diff) |
Merge if statements
Issue-ID: CLI-100
Change-Id: Id0db2e9e51b68009177d4847a4b24d2f84c1cb50
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src/main')
-rw-r--r-- | framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java b/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java index 032dc162..a5c0826d 100644 --- a/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java +++ b/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java @@ -92,9 +92,9 @@ import org.yaml.snakeyaml.Yaml; public class OnapCommandSchemaLoader { - private OnapCommandSchemaLoader() { - // As per the java guidelines - } + private OnapCommandSchemaLoader() { + // As per the java guidelines + } /** * Validates schema version. @@ -341,12 +341,11 @@ public class OnapCommandSchemaLoader { break; case IS_OPTIONAL: - if (validate) { - if (!OnapCommandUtils.validateBoolean(String.valueOf(parameter.get(key2)))) { - exceptionList.add(OnapCommandUtils.invalidBooleanValueMessage(parameter.get(NAME), - IS_SECURED, parameter.get(key2))); - } + if (validate && !OnapCommandUtils.validateBoolean(String.valueOf(parameter.get(key2)))) { + exceptionList.add(OnapCommandUtils.invalidBooleanValueMessage(parameter.get(NAME), + IS_SECURED, parameter.get(key2))); } + if (BOOLEAN_TRUE.equalsIgnoreCase(String.valueOf(parameter.get(key2)))) { param.setOptional(true); } else { @@ -370,11 +369,9 @@ public class OnapCommandSchemaLoader { break; case IS_INCLUDE: - if (validate) { - if (!OnapCommandUtils.validateBoolean(String.valueOf(parameter.get(key2)))) { - exceptionList.add(OnapCommandUtils.invalidBooleanValueMessage(parameter.get(NAME), - IS_INCLUDE, parameter.get(key2))); - } + if (validate && !OnapCommandUtils.validateBoolean(String.valueOf(parameter.get(key2)))) { + exceptionList.add(OnapCommandUtils.invalidBooleanValueMessage(parameter.get(NAME), + IS_INCLUDE, parameter.get(key2))); } if (BOOLEAN_TRUE.equalsIgnoreCase(String.valueOf(parameter.get(key2)))) { |