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.internal;
12 import java.io.Serializable;
14 import org.apache.commons.lang3.builder.EqualsBuilder;
15 import org.apache.commons.lang3.builder.HashCodeBuilder;
16 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
18 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
19 import org.opendaylight.controller.sal.core.Node;
22 * Class that represent a pair of {Host, Node}, the intent of it
23 * is to be used as a key in the database kept by IPSwitching module
24 * where for every Host, Switch we will have a Forwarding Rule that
25 * will route the traffic toward the /32 destination
28 public class HostNodePair implements Serializable {
29 private static final long serialVersionUID = 1L;
30 private HostNodeConnector host;
33 public HostNodePair(HostNodeConnector h, Node s) {
38 public Node getNode() {
42 public void setNode(Node nodeId) {
46 public HostNodeConnector getHost() {
50 public void setHost(HostNodeConnector host) {
55 public int hashCode() {
56 return HashCodeBuilder.reflectionHashCode(this);
60 public boolean equals(Object obj) {
61 return EqualsBuilder.reflectionEquals(this, obj);
65 public String toString() {
66 return "HostNodePair[" + ReflectionToStringBuilder.toString(this) + "]";