package org.opennaas.extensions.vcpe.model;
/*
* #%L
* OpenNaaS :: vCPENetwork
* %%
* Copyright (C) 2007 - 2014 FundaciĆ³ Privada i2CAT, Internet i InnovaciĆ³ a Catalunya
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlIDREF;
import javax.xml.bind.annotation.XmlSeeAlso;
import org.opennaas.extensions.vcpe.model.routing.RoutingConfiguration;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlSeeAlso({ LogicalRouter.class, PhysicalRouter.class })
public class Router extends VCPENetworkElement {
@XmlIDREF
protected List<Interface> interfaces;
protected RoutingConfiguration routingConfiguration;
public List<Interface> getInterfaces() {
return interfaces;
}
public void setInterfaces(List<Interface> interfaces) {
this.interfaces = interfaces;
}
public RoutingConfiguration getRoutingConfiguration() {
return routingConfiguration;
}
public void setRoutingConfiguration(RoutingConfiguration routingConfiguration) {
this.routingConfiguration = routingConfiguration;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((interfaces == null) ? 0 : interfaces.hashCode());
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
Router other = (Router) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (templateName == null) {
if (other.templateName != null)
return false;
} else if (!templateName.equals(other.templateName))
return false;
if (interfaces == null) {
if (other.interfaces != null)
return false;
} else if (!interfaces.equals(other.interfaces))
return false;
if (routingConfiguration == null) {
if (other.routingConfiguration != null)
return false;
} else if (!routingConfiguration.equals(other.routingConfiguration))
return false;
return true;
}
}