package org.opendaylight.controller.sal.core;
+import java.util.Arrays;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
/**
@Override
public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + Arrays.hashCode(controllerMacAddress);
+ result = prime * result + Arrays.hashCode(nodeMacAddress);
+ 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;
+ MacAddress other = (MacAddress) obj;
+ if (!Arrays.equals(controllerMacAddress, other.controllerMacAddress))
+ return false;
+ if (!Arrays.equals(nodeMacAddress, other.nodeMacAddress))
+ return false;
+ return true;
}
@Override
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-
/**
* The class represents the Name property of an element.
*/
@Override
public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((nameValue == null) ? 0 : nameValue.hashCode());
+ 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;
+ Name other = (Name) obj;
+ if (nameValue == null) {
+ if (other.nameValue != null)
+ return false;
+ } else if (!nameValue.equals(other.nameValue))
+ return false;
+ return true;
}
@Override
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.opendaylight.controller.sal.utils.HexEncode;
/**
}
}
- /**
+ /**
* Private setter for nodeType to be called by JAXB not by anyone
* else, Node is immutable
- *
+ *
* @param type of node to be set
*/
private void setType(String type) {
return this.nodeID.toString();
}
}
-
- /**
+
+ /**
* private setter to be used by JAXB
- *
+ *
* @param nodeIDString String representation for NodeID
*/
private void setNodeIDString(String nodeIDString) {
@Override
public int hashCode() {
- return new HashCodeBuilder(163841, 56473)
- .append(nodeType)
- .append(nodeID)
- .hashCode();
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((nodeID == null) ? 0 : nodeID.hashCode());
+ result = prime * result
+ + ((nodeType == null) ? 0 : nodeType.hashCode());
+ return result;
}
@Override
public boolean equals(Object obj) {
- if (obj == null) { return false; }
- if (obj == this) { return true; }
- if (obj.getClass() != getClass()) {
+ if (this == obj)
+ return true;
+ if (obj == null)
return false;
- }
- Node rhs = (Node)obj;
- return new EqualsBuilder()
- .append(this.getType(), rhs.getType())
- .append(this.getID(), rhs.getID())
- .isEquals();
+ if (getClass() != obj.getClass())
+ return false;
+ Node other = (Node) obj;
+ if (nodeID == null) {
+ if (other.nodeID != null)
+ return false;
+ } else if (!nodeID.equals(other.nodeID))
+ return false;
+ if (nodeType == null) {
+ if (other.nodeType != null)
+ return false;
+ } else if (!nodeType.equals(other.nodeType))
+ return false;
+ return true;
}
@Override
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.tuple.ImmutablePair;
/**
ConcurrentHashMap<String, ImmutablePair<Class<? extends Object>, String>> compatibleType =
new ConcurrentHashMap<String, ImmutablePair<Class<? extends Object>, String>>();
/**
- * Represents the OFPP_CONTROLLER reserved port to forward a
- * packet to the controller, this is to send data packets
- * to the controller from the data plane triggering
+ * Represents the OFPP_CONTROLLER reserved port to forward a
+ * packet to the controller, this is to send data packets
+ * to the controller from the data plane triggering
* a packet_in event.
*/
public static String CONTROLLER = "CTRL";
/**
- * Represents the OFPP_ALL reserved OF port
+ * Represents the OFPP_ALL reserved OF port
* to forward to ALL the ports in the system ,
* should be used for flooding like mechanism to
* be used cautiously to avoid excessive flooding.
*/
public static String SWSTACK = "SW";
/**
- * Describes OFPP_Normal reserved port destination that invokes
- * the traditional native L2/L3 HW normal forwarding functionality
+ * Describes OFPP_Normal reserved port destination that invokes
+ * the traditional native L2/L3 HW normal forwarding functionality
* if supported on the forwarding element.
*/
public static String HWPATH = "HW";
}
}
- /**
+ /**
* Private setter for nodeConnectorType to be called by JAXB not by anyone
* else, NodeConnector is immutable
- *
+ *
* @param type of node to be set
*/
private void setType(String type) {
return this.nodeConnectorID.toString();
}
- /**
+ /**
* private setter to be used by JAXB
- *
+ *
* @param nodeConnectorIDString String representation for NodeConnectorID
*/
private void setNodeConnectorIDString(String IDStr) {
@Override
public int hashCode() {
- return new HashCodeBuilder(63389, 4951)
- .append(nodeConnectorType)
- .append(nodeConnectorID)
- .append(nodeConnectorNode)
- .hashCode();
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((nodeConnectorID == null) ? 0 : nodeConnectorID.hashCode());
+ result = prime
+ * result
+ + ((nodeConnectorNode == null) ? 0 : nodeConnectorNode
+ .hashCode());
+ result = prime
+ * result
+ + ((nodeConnectorType == null) ? 0 : nodeConnectorType
+ .hashCode());
+ return result;
}
@Override
public boolean equals(Object obj) {
- if (obj == null) { return false; }
- if (obj == this) { return true; }
- if (obj.getClass() != getClass()) {
+ if (this == obj)
+ return true;
+ if (obj == null)
return false;
- }
- NodeConnector rhs = (NodeConnector)obj;
- return new EqualsBuilder()
- .append(this.getType(), rhs.getType())
- .append(this.getID(), rhs.getID())
- .append(this.getNode(), rhs.getNode())
- .isEquals();
+ if (getClass() != obj.getClass())
+ return false;
+ NodeConnector other = (NodeConnector) obj;
+ if (nodeConnectorID == null) {
+ if (other.nodeConnectorID != null)
+ return false;
+ } else if (!nodeConnectorID.equals(other.nodeConnectorID))
+ return false;
+ if (nodeConnectorNode == null) {
+ if (other.nodeConnectorNode != null)
+ return false;
+ } else if (!nodeConnectorNode.equals(other.nodeConnectorNode))
+ return false;
+ if (nodeConnectorType == null) {
+ if (other.nodeConnectorType != null)
+ return false;
+ } else if (!nodeConnectorType.equals(other.nodeConnectorType))
+ return false;
+ return true;
}
@Override
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
/**
* Describe a path as a sequence of Edge such that from
@Override
public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((edges == null) ? 0 : edges.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;
+ Path other = (Path) obj;
+ if (edges == null) {
+ if (other.edges != null)
+ return false;
+ } else if (!edges.equals(other.edges))
+ return false;
+ return true;
}
@Override