X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fauthorization%2FResource.java;h=9cf7420d1b01c7622d7d0576ccb0493456891001;hp=ef8744b551bb2aea811f0b92ce4b77e2248942b0;hb=5d121f4f8efb3f08ced19d6378c45166701bf318;hpb=42210c03b0a4c54706320ba9f55794c0abd4d201 diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/Resource.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/Resource.java index ef8744b551..9cf7420d1b 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/Resource.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/authorization/Resource.java @@ -11,9 +11,6 @@ package org.opendaylight.controller.sal.authorization; import java.io.Serializable; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; - /** * It represents the elementary resource along with * the access privilege associated to it @@ -38,12 +35,32 @@ public class Resource implements Serializable { @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + final int prime = 31; + int result = 1; + result = prime * result + + ((privilege == null) ? 0 : privilege.hashCode()); + result = prime * result + + ((resource == null) ? 0 : resource.hashCode()); + return result; } @Override public boolean equals(Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Resource other = (Resource) obj; + if (privilege != other.privilege) + return false; + if (resource == null) { + if (other.resource != null) + return false; + } else if (!resource.equals(other.resource)) + return false; + return true; } @Override