X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Fvendorextension%2Fv6extension%2FV6StatsReply.java;h=bd3c2a2c04e95fb01ce31c1d595ba02069b8a04a;hb=7c3362df780f30a47d0f6a7b7695360bbb5513bc;hp=1b14ab069aa6eae36bcaf5e250cbf3ebf2a9a05f;hpb=29f7cfb54b580928c7feac63abce028a7014b0d5;p=controller.git diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsReply.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsReply.java index 1b14ab069a..bd3c2a2c04 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsReply.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsReply.java @@ -12,9 +12,6 @@ package org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6e import java.nio.ByteBuffer; import java.util.List; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.openflow.protocol.action.OFAction; import org.openflow.protocol.statistics.OFVendorStatistics; import org.openflow.util.U16; @@ -22,9 +19,9 @@ import org.openflow.util.U16; /** * This Class processes the OpenFlow Vendor Extension Reply message of a Stats * Request. It parses the reply message and initializes fields of V6StatsReply - * object. Multiple instances of this class objects are created and used by - * ONE Controller's Troubleshooting Application. - * + * object. Multiple instances of this class objects are created and used by + * OpenDaylight's Troubleshooting Application. + * */ public class V6StatsReply extends OFVendorStatistics { @@ -314,17 +311,84 @@ public class V6StatsReply extends OFVendorStatistics { @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((actions == null) ? 0 : actions.hashCode()); + result = prime * result + (int) (byteCount ^ (byteCount >>> 32)); + result = prime * result + (int) (cookie ^ (cookie >>> 32)); + result = prime * result + durationNanoseconds; + result = prime * result + durationSeconds; + result = prime * result + hardAge; + result = prime * result + hardTimeout; + result = prime * result + idleAge; + result = prime * result + idleTimeout; + result = prime * result + length; + result = prime * result + ((match == null) ? 0 : match.hashCode()); + result = prime * result + match_len; + result = prime * result + (int) (packetCount ^ (packetCount >>> 32)); + result = prime * result + priority; + result = prime * result + tableId; + return result; } @Override public String toString() { - return "V6StatsReply[" + ReflectionToStringBuilder.toString(this) + "]"; + return "V6StatsReply [length=" + length + ", tableId=" + tableId + + ", durationSeconds=" + durationSeconds + + ", durationNanoseconds=" + durationNanoseconds + + ", priority=" + priority + ", idleTimeout=" + idleTimeout + + ", hardTimeout=" + hardTimeout + ", match_len=" + match_len + + ", idleAge=" + idleAge + ", hardAge=" + hardAge + ", cookie=" + + cookie + ", packetCount=" + packetCount + ", byteCount=" + + byteCount + ", match=" + match + ", actions=" + actions + "]"; } @Override public boolean equals(Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + V6StatsReply other = (V6StatsReply) obj; + if (actions == null) { + if (other.actions != null) + return false; + } else if (!actions.equals(other.actions)) + return false; + if (byteCount != other.byteCount) + return false; + if (cookie != other.cookie) + return false; + if (durationNanoseconds != other.durationNanoseconds) + return false; + if (durationSeconds != other.durationSeconds) + return false; + if (hardAge != other.hardAge) + return false; + if (hardTimeout != other.hardTimeout) + return false; + if (idleAge != other.idleAge) + return false; + if (idleTimeout != other.idleTimeout) + return false; + if (length != other.length) + return false; + if (match == null) { + if (other.match != null) + return false; + } else if (!match.equals(other.match)) + return false; + if (match_len != other.match_len) + return false; + if (packetCount != other.packetCount) + return false; + if (priority != other.priority) + return false; + if (tableId != other.tableId) + return false; + return true; } }