aboutsummaryrefslogtreecommitdiffstats
path: root/profiles
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-05-02 15:53:02 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-05-03 17:36:55 +0530
commit2575b3ccf5ca48a1ca0a2adb81a21ec602f6ae4e (patch)
tree110c13f6238853bd4abd75750eeb67ee6223ec47 /profiles
parent16310b3ed629cfdf849034bfe714063e9f047bf5 (diff)
Use static constants instead
Issue-ID: CLI-100 Change-Id: I606b9428669c603e476cda1f77f5015ab57c9eba Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'profiles')
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
index 2cfb5206..55295aa5 100644
--- a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
+++ b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
@@ -47,6 +47,8 @@ import net.minidev.json.JSONObject;
public class OnapCommandSchemaHttpLoader {
+ private static final String ATTRIBUTE = "Attribute '";
+
private OnapCommandSchemaHttpLoader() {
// to follow standards !
}
@@ -178,11 +180,11 @@ public class OnapCommandSchemaHttpLoader {
if (serviceMap.containsKey(secKey)) {
Object obj = serviceMap.get(secKey);
if (obj == null) {
- errorList.add("Attribute '" + secKey + "' under '" + OnapCommandHttpConstants.SERVICE + "' is empty");
+ errorList.add(ATTRIBUTE + secKey + "' under '" + OnapCommandHttpConstants.SERVICE + "' is empty");
} else {
String value = String.valueOf(obj);
if (!OnapCommandConfig.getCommaSeparatedList(validationMap.get(secKey)).contains(value)) {
- errorList.add("Attribute '" + secKey + "' contains invalid value. Valide values are "
+ errorList.add(ATTRIBUTE + secKey + "' contains invalid value. Valide values are "
+ OnapCommandConfig.getCommaSeparatedList(validationMap.get(key1))); //
}
}
@@ -288,7 +290,7 @@ public class OnapCommandSchemaHttpLoader {
String method = (String) requestMap.get(OnapCommandHttpConstants.METHOD);
if (method != null && !method.isEmpty()) {
if (!OnapCommandConfig.getCommaSeparatedList(OnapCommandHttpConstants.HTTP_METHODS).contains(method.toLowerCase())) {
- errorList.add("Attribute '" + OnapCommandHttpConstants.METHOD + "' under '" + OnapCommandHttpConstants.REQUEST + "' is invalid, correct types are "
+ errorList.add(ATTRIBUTE + OnapCommandHttpConstants.METHOD + "' under '" + OnapCommandHttpConstants.REQUEST + "' is invalid, correct types are "
+ OnapCommandConfig.getCommaSeparatedList(OnapCommandHttpConstants.HTTP_METHODS).toString());
}
} else {