1 package org.opendaylight.controller.sal.action;
3 import java.net.InetAddress;
5 import javax.xml.bind.annotation.XmlAccessType;
6 import javax.xml.bind.annotation.XmlAccessorType;
7 import javax.xml.bind.annotation.XmlElement;
8 import javax.xml.bind.annotation.XmlRootElement;
11 @XmlAccessorType(XmlAccessType.NONE)
12 public class SetNextHop extends Action {
13 private static final long serialVersionUID = 1L;
15 private InetAddress address;
17 /* Dummy constructor for JAXB */
18 @SuppressWarnings("unused")
19 private SetNextHop() {
22 public SetNextHop(InetAddress address) {
23 type = ActionType.SET_NEXT_HOP;
24 this.address = address;
27 public InetAddress getAddress() {
32 public int hashCode() {
34 int result = super.hashCode();
35 result = prime * result + ((address == null) ? 0 : address.hashCode());
40 public boolean equals(Object obj) {
44 if (!super.equals(obj)) {
47 if (getClass() != obj.getClass()) {
50 SetNextHop other = (SetNextHop) obj;
51 if (address == null) {
52 if (other.address != null) {
55 } else if (!address.equals(other.address)) {
62 public String toString() {
63 return type + "[" + address.toString() + "]";