diff options
author | Piotr Borelowski <p.borelowski@partner.samsung.com> | 2019-06-07 10:37:34 +0200 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2019-06-17 07:14:31 +0000 |
commit | 7db579a2da7d6a9dc066461067c2e1ce713f2133 (patch) | |
tree | a0e1710f707d25113861b1c1aca863bec651caac | |
parent | c13c9dd3e79565a7c909f76a48fe3d02388cef43 (diff) |
Renamed the field 'statusCode'
Removing the sonar issues in the package
org.onap.sdc.common.onaplog.enums
Issue-ID: SDC-2327
Signed-off-by: Piotr Borelowski <p.borelowski@partner.samsung.com>
Change-Id: I713e9fdebe8cdccf9785af3882448aa113bb3c49
-rw-r--r-- | src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java b/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java index da645a9..05bbbb7 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java +++ b/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java @@ -4,11 +4,13 @@ public enum StatusCode { ERROR("ERROR"), COMPLETE("COMPLETE"); - String statusCode; + private String text; - StatusCode(String statusCode){this.statusCode = statusCode;} + StatusCode(String text) { + this.text = text; + } - public String getStatusCodeEnum(){ - return statusCode; + public String getText() { + return text; } } diff --git a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java index d4cc26d..787b377 100644 --- a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java +++ b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java @@ -106,7 +106,8 @@ public class OnapLoggerAudit extends OnapLoggerBase { public OnapLoggerAudit setStatusCode(String statusCode) { // status code is either success (COMPLETE) or failure (ERROR) of the request. - String respStatus = Integer.parseInt(statusCode) / 100 == 2 ? StatusCode.COMPLETE.getStatusCodeEnum() : StatusCode.ERROR.getStatusCodeEnum(); + String respStatus = Integer.parseInt(statusCode) / 100 == 2 ? + StatusCode.COMPLETE.getText() : StatusCode.ERROR.getText(); onapMDCWrapper.setStatusCode(respStatus); return this; } |