3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.samples.simpleforwarding;
12 import java.io.Serializable;
14 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
15 import org.opendaylight.controller.sal.core.Node;
18 * Class that represent a pair of {Host, Node}, the intent of it
19 * is to be used as a key in the database kept by IPSwitching module
20 * where for every Host, Switch we will have a Forwarding Rule that
21 * will route the traffic toward the /32 destination
24 public class HostNodePair implements Serializable {
25 private static final long serialVersionUID = 1L;
26 private HostNodeConnector host;
29 public HostNodePair(HostNodeConnector h, Node s) {
34 public Node getNode() {
38 public void setNode(Node nodeId) {
42 public HostNodeConnector getHost() {
46 public void setHost(HostNodeConnector host) {
51 public int hashCode() {
54 result = prime * result + ((host == null) ? 0 : host.hashCode());
55 result = prime * result + ((node == null) ? 0 : node.hashCode());
60 public boolean equals(Object obj) {
65 if (getClass() != obj.getClass())
67 HostNodePair other = (HostNodePair) obj;
69 if (other.host != null)
71 } else if (!host.equals(other.host))
74 if (other.node != null)
76 } else if (!node.equals(other.node))
82 public String toString() {
83 return "HostNodePair [host=" + host + ", node=" + node + "]";