Merge "Add StatusCode.CREATED"
authorGiovanni Meo <gmeo@cisco.com>
Thu, 5 Dec 2013 15:03:47 +0000 (15:03 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 5 Dec 2013 15:03:47 +0000 (15:03 +0000)
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/Status.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/StatusCode.java

index 00ac84fcc1ef54ee515ac4421bba972e13c0ea56..0387f72f382da08bc1ec395e73158d11545e253c 100644 (file)
@@ -101,7 +101,7 @@ public class Status implements Serializable {
      * @return true if the Status code is {@code StatusCode.SUCCESS}
      */
     public boolean isSuccess() {
-        return code == StatusCode.SUCCESS;
+        return code == StatusCode.SUCCESS || code == StatusCode.CREATED;
     }
 
     /**
@@ -130,15 +130,19 @@ public class Status implements Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         Status other = (Status) obj;
-        if (code != other.code)
+        if (code != other.code) {
             return false;
+        }
         return true;
     }
 }
index 86b0d53fba70a797dac4059102f007a1d4805137..f8882bbd2f81663023c95dd2b8b980d2e9754687 100644 (file)
@@ -15,6 +15,7 @@ package org.opendaylight.controller.sal.utils;
  */
 public enum StatusCode {
         SUCCESS("Success"),
+        CREATED("Created"),
 
         BADREQUEST("Bad Request"),
         UNAUTHORIZED("UnAuthorized"),