X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fswitchmanager%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fswitchmanager%2FSwitchConfig.java;h=253096edc34116ed4cc9474624f9711f90efa13a;hb=ff1b4a79cca00743a00c3b0b1100bd0ab2b2fb31;hp=ffb8ec042c619e9f28485a76a56fb3143adcfeca;hpb=9e43cfabdc83df4c5db51ce6e22e0cecca12aa9a;p=controller.git diff --git a/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SwitchConfig.java b/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SwitchConfig.java index ffb8ec042c..253096edc3 100644 --- a/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SwitchConfig.java +++ b/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SwitchConfig.java @@ -11,9 +11,6 @@ package org.opendaylight.controller.switchmanager; import java.io.Serializable; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; - /** * The class describes a switch configuration including node identifier, node * name, tier number and proactive/reactive mode. @@ -50,20 +47,54 @@ public class SwitchConfig implements Serializable { } public boolean isProactive() { - return Integer.parseInt(mode) != 0; + return Integer.parseInt(mode) != 0; } - + public static long getSerialversionuid() { return serialVersionUID; } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + final int prime = 31; + int result = 1; + result = prime * result + + ((description == null) ? 0 : description.hashCode()); + result = prime * result + ((mode == null) ? 0 : mode.hashCode()); + result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode()); + result = prime * result + ((tier == null) ? 0 : tier.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; + SwitchConfig other = (SwitchConfig) obj; + if (description == null) { + if (other.description != null) + return false; + } else if (!description.equals(other.description)) + return false; + if (mode == null) { + if (other.mode != null) + return false; + } else if (!mode.equals(other.mode)) + return false; + if (nodeId == null) { + if (other.nodeId != null) + return false; + } else if (!nodeId.equals(other.nodeId)) + return false; + if (tier == null) { + if (other.tier != null) + return false; + } else if (!tier.equals(other.tier)) + return false; + return true; } }