Merge "toaster-it: add missing version for maven-paxexam-plugin"
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / Config.java
index c585aa2c9f46a0e36768e65134d4cebf5fa756e1..ef6efc58211577fb9799509c1d998949a44364dc 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -9,12 +8,8 @@
 
 package org.opendaylight.controller.sal.core;
 
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-
-import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
 
 /**
  * The class represents Admin Config status
@@ -24,7 +19,7 @@ import javax.xml.bind.annotation.XmlElement;
 @XmlRootElement
 @SuppressWarnings("serial")
 public class Config extends Property {
-    @XmlElement
+    @XmlElement(name="value")
     private short configValue;
 
     public static final short ADMIN_DOWN = 0;
@@ -45,6 +40,7 @@ public class Config extends Property {
         this.configValue = config;
     }
 
+    @Override
     public Config clone() {
         return new Config(this.configValue);
     }
@@ -55,16 +51,28 @@ public class Config extends Property {
 
     @Override
     public int hashCode() {
-        return HashCodeBuilder.reflectionHashCode(this);
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result + configValue;
+        return result;
     }
 
     @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;
+        Config other = (Config) obj;
+        if (configValue != other.configValue)
+            return false;
+        return true;
     }
 
     @Override
     public String toString() {
-        return "Config[" + ReflectionToStringBuilder.toString(this) + "]";
+        return "Config["+ configValue +"]";
     }
 }