import java.util.ArrayList;
import java.util.List;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
import org.opendaylight.controller.sal.utils.GUIField;
-
-import org.opendaylight.controller.switchmanager.SpanConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Override
public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
+ result = prime * result
+ + ((spanPort == null) ? 0 : spanPort.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;
+ SpanConfig other = (SpanConfig) obj;
+ if (nodeId == null) {
+ if (other.nodeId != null)
+ return false;
+ } else if (!nodeId.equals(other.nodeId))
+ return false;
+ if (spanPort == null) {
+ if (other.spanPort != null)
+ return false;
+ } else if (!spanPort.equals(other.spanPort))
+ return false;
+ return true;
}
public static ArrayList<String> getFieldsNames() {
import java.util.HashSet;
import java.util.Set;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.switchmanager.Subnet;
-import org.opendaylight.controller.switchmanager.SubnetConfig;
-
/**
* The class describes subnet information including L3 address, vlan and set of
* ports associated with the subnet.
return this;
}
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
@Override
public int hashCode() {
- return new HashCodeBuilder().append(networkAddress).append(
- subnetMaskLength).toHashCode();
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((networkAddress == null) ? 0 : networkAddress.hashCode());
+ result = prime * result
+ + ((nodeConnectors == null) ? 0 : nodeConnectors.hashCode());
+ result = prime * result + subnetMaskLength;
+ result = prime * result + vlan;
+ return result;
}
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
@Override
public boolean equals(Object obj) {
- if (this == obj) {
+ if (this == obj)
return true;
- }
- if (obj == null) {
+ if (obj == null)
return false;
- }
- if (obj.getClass() != getClass()) {
+ if (getClass() != obj.getClass())
return false;
- }
Subnet other = (Subnet) obj;
- // Check only equality for the key fields
- return new EqualsBuilder().append(networkAddress, other.networkAddress)
- .append(subnetMaskLength, other.subnetMaskLength).isEquals();
+ if (networkAddress == null) {
+ if (other.networkAddress != null)
+ return false;
+ } else if (!networkAddress.equals(other.networkAddress))
+ return false;
+ if (nodeConnectors == null) {
+ if (other.nodeConnectors != null)
+ return false;
+ } else if (!nodeConnectors.equals(other.nodeConnectors))
+ return false;
+ if (subnetMaskLength != other.subnetMaskLength)
+ return false;
+ if (vlan != other.vlan)
+ return false;
+ return true;
}
/* (non-Javadoc)
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
@Override
public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + Arrays.hashCode(dataLayerAddress);
+ result = prime * result + ((node == null) ? 0 : node.hashCode());
+ result = prime * result
+ + ((nodeConnectors == null) ? 0 : nodeConnectors.hashCode());
+ result = prime * result
+ + ((spanPorts == null) ? 0 : spanPorts.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;
+ Switch other = (Switch) obj;
+ if (!Arrays.equals(dataLayerAddress, other.dataLayerAddress))
+ return false;
+ if (node == null) {
+ if (other.node != null)
+ return false;
+ } else if (!node.equals(other.node))
+ return false;
+ if (nodeConnectors == null) {
+ if (other.nodeConnectors != null)
+ return false;
+ } else if (!nodeConnectors.equals(other.nodeConnectors))
+ return false;
+ if (spanPorts == null) {
+ if (other.spanPorts != null)
+ return false;
+ } else if (!spanPorts.equals(other.spanPorts))
+ return false;
+ return true;
}
@Override
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.
@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;
}
}
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.opendaylight.controller.sal.authorization.AuthResultEnum;
import org.opendaylight.controller.sal.utils.Status;
import org.opendaylight.controller.sal.utils.StatusCode;
@Override
public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((password == null) ? 0 : password.hashCode());
+ result = prime * result + ((roles == null) ? 0 : roles.hashCode());
+ result = prime * result + ((user == null) ? 0 : user.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;
+ UserConfig other = (UserConfig) obj;
+ if (password == null) {
+ if (other.password != null)
+ return false;
+ } else if (!password.equals(other.password))
+ return false;
+ if (roles == null) {
+ if (other.roles != null)
+ return false;
+ } else if (!roles.equals(other.roles))
+ return false;
+ if (user == null) {
+ if (other.user != null)
+ return false;
+ } else if (!user.equals(other.user))
+ return false;
+ return true;
}
@Override