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)
20 public class SetNextHop extends Action {
21 private static final long serialVersionUID = 1L;
23 private InetAddress address;
25 /* Dummy constructor for JAXB */
26 @SuppressWarnings("unused")
27 private SetNextHop() {
30 public SetNextHop(InetAddress address) {
31 type = ActionType.SET_NEXT_HOP;
32 this.address = address;
35 public InetAddress getAddress() {
40 public int hashCode() {
42 int result = super.hashCode();
43 result = prime * result + ((address == null) ? 0 : address.hashCode());
48 public boolean equals(Object obj) {
52 if (!super.equals(obj)) {
55 if (getClass() != obj.getClass()) {
58 SetNextHop other = (SetNextHop) obj;
59 if (address == null) {
60 if (other.address != null) {
63 } else if (!address.equals(other.address)) {
70 public String toString() {
71 return type + "[" + address.toString() + "]";