package org.opennaas.extensions.openflowswitch.model; /* * #%L * OpenNaaS :: OpenFlow Switch * %% * 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.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; /** * * @author Adrian Rosello (i2CAT) * */ @XmlAccessorType(XmlAccessType.FIELD) public class OFFlowTable { private String tableId; private List<OFFlow> ofForwardingRules; public OFFlowTable() { tableId = new String(); ofForwardingRules = new ArrayList<OFFlow>(); } public String getTableId() { return tableId; } public void setTableId(String tableId) { this.tableId = tableId; } public List<OFFlow> getOfForwardingRules() { return ofForwardingRules; } public void setOfForwardingRules(List<OFFlow> ofForwardingRules) { this.ofForwardingRules = ofForwardingRules; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((ofForwardingRules == null) ? 0 : ofForwardingRules.hashCode()); result = prime * result + ((tableId == null) ? 0 : tableId.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OFFlowTable other = (OFFlowTable) obj; if (ofForwardingRules == null) { if (other.ofForwardingRules != null) return false; } else if (!ofForwardingRules.equals(other.ofForwardingRules)) return false; if (tableId == null) { if (other.tableId != null) return false; } else if (!tableId.equals(other.tableId)) return false; return true; } }