Updating features archetype to talk about user-facing features.
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / vendorextension / v6extension / V6StatsRequest.java
index 26d0065a45162ca493a5c15266d4b405ecc338ab..d9c460b32e25b310340eb58ea1f85447a5dbe8e2 100644 (file)
@@ -9,17 +9,15 @@
 
 package org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6extension;
 
-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.statistics.OFVendorStatistics;
 import java.nio.ByteBuffer;
 
+import org.openflow.protocol.statistics.OFVendorStatistics;
+
 
 /**
- * This Class creates the OpenFlow Vendor Extension IPv6 Flow Stats Request 
+ * This Class creates the OpenFlow Vendor Extension IPv6 Flow Stats Request
  * messages and also reads the Reply of a stats request message.
- * 
+ *
  */
 
 public class V6StatsRequest extends OFVendorStatistics {
@@ -121,8 +119,9 @@ public class V6StatsRequest extends OFVendorStatistics {
         this.outPort = data.getShort();
         this.match_len = data.getShort();
         this.tableId = data.get();
-        for (int i = 0; i < 3; i++)
+        for (int i = 0; i < 3; i++) {
             data.get();//pad byte
+        }
 
     }
 
@@ -134,23 +133,46 @@ public class V6StatsRequest extends OFVendorStatistics {
         data.putShort(this.outPort);
         data.putShort(this.match_len);
         data.put(this.tableId);
-        for (int i = 0; i < 3; i++)
+        for (int i = 0; i < 3; i++)  {
             data.put((byte) 0x0);//pad byte
+        }
     }
 
     @Override
     public int hashCode() {
-        return HashCodeBuilder.reflectionHashCode(this);
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result + match_len;
+        result = prime * result + msgsubtype;
+        result = prime * result + outPort;
+        result = prime * result + tableId;
+        return result;
     }
 
     @Override
     public String toString() {
-        return "V6StatsRequest[" + ReflectionToStringBuilder.toString(this)
+        return "V6StatsRequest [msgsubtype=" + msgsubtype + ", outPort="
+                + outPort + ", match_len=" + match_len + ", tableId=" + tableId
                 + "]";
     }
 
     @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;
+        V6StatsRequest other = (V6StatsRequest) obj;
+        if (match_len != other.match_len)
+            return false;
+        if (msgsubtype != other.msgsubtype)
+            return false;
+        if (outPort != other.outPort)
+            return false;
+        if (tableId != other.tableId)
+            return false;
+        return true;
     }
 }