Added the "@Override" annotation 87/13787/11
authorrama-huawei <rama.subba.reddy.s@huawei.com>
Wed, 20 Sep 2017 09:05:38 +0000 (14:35 +0530)
committerRama SubbaReddy <rama.subba.reddy.s@huawei.com>
Wed, 20 Sep 2017 15:14:22 +0000 (15:14 +0000)
1) Move the string literal on the left side of the actual string comparison.

Issue-ID: POLICY-239
Change-Id: I3185a00c815aee8d25637d8646221eb87608f989
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyParameters.java
PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyResponseStatus.java
PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyType.java
PolicyEngineAPI/src/main/java/org/onap/policy/api/RuleProvider.java

index 1078916..2062638 100644 (file)
@@ -568,6 +568,7 @@ public class PolicyParameters {
                this.extendedOption = extendedOption;
        }
        
+       @Override
        public String toString() {
                return "PolicyParameters [ policyName=" + policyName + ", policyDescription=" + policyDescription + ", onapName="+ onapName 
                                + ", configName=" + configName + ", attributes=" + attributes + ", configBody=" + configBody 
index 4368b64..63cb918 100644 (file)
@@ -55,9 +55,9 @@ public enum PolicyResponseStatus {
         * @return the <code>PolicyResponseStatus</code> with the name matching <code>ACTION_ADVISED</code> or <code>ACTION_TAKEN</code> or <code>NO_ACTION_REQUIRED</code>
         */
        public static PolicyResponseStatus getStatus(String responseStatus) {
-               if(responseStatus.equalsIgnoreCase("action_advised")) {
+               if("action_advised".equalsIgnoreCase(responseStatus)) {
                        return ACTION_ADVISED;
-               }else if(responseStatus.equalsIgnoreCase("action_taken")) {
+               }else if("action_taken".equalsIgnoreCase(responseStatus)) {
                        return ACTION_TAKEN;
                }else {
                        return NO_ACTION_REQUIRED;
@@ -69,6 +69,7 @@ public enum PolicyResponseStatus {
         * 
         * @return the <code>String</code> name for this <code>PolicyResponseStatus</code>
         */
+       @Override
        public String toString(){
                return this.name;
        }
index f026596..a29a6c4 100644 (file)
@@ -57,6 +57,7 @@ public enum PolicyType {
         * Returns the <code>String</code> format of Type for this <code>PolicyType</code>
         * @return the <code>String</code> of the Type for this <code>PolicyType</code>
         */
+       @Override
        public String toString() {
                return this.name;
        }
index c34e05e..94ad678 100644 (file)
@@ -57,6 +57,7 @@ public enum RuleProvider {
         * Returns the <code>String</code> format of Type for this <code>AttributeType</code>
         * @return the <code>String</code> of the Type for this <code>AttributeType</code>
         */
+       @Override
        public String toString() {
                return this.name;
        }