2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.sal.action;
10 import java.net.InetAddress;
12 import javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
18 @XmlAccessorType(XmlAccessType.NONE)
19 public class SetNextHop extends Action {
20 private static final long serialVersionUID = 1L;
22 private InetAddress address;
24 /* Dummy constructor for JAXB */
25 @SuppressWarnings("unused")
26 private SetNextHop() {
29 public SetNextHop(InetAddress address) {
30 type = ActionType.SET_NEXT_HOP;
31 this.address = address;
34 public InetAddress getAddress() {
39 public int hashCode() {
41 int result = super.hashCode();
42 result = prime * result + ((address == null) ? 0 : address.hashCode());
47 public boolean equals(Object obj) {
51 if (!super.equals(obj)) {
54 if (getClass() != obj.getClass()) {
57 SetNextHop other = (SetNextHop) obj;
58 if (address == null) {
59 if (other.address != null) {
62 } else if (!address.equals(other.address)) {
69 public String toString() {
70 return type + "[" + address.toString() + "]";