2 * Copyright (c) 2013 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
9 package org.opendaylight.controller.sal.action;
11 import java.net.InetAddress;
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
19 * Set network destination address action
23 @XmlAccessorType(XmlAccessType.NONE)
25 public class SetNwDst extends Action {
26 private static final long serialVersionUID = 1L;
29 /* Dummy constructor for JAXB */
30 @SuppressWarnings("unused")
34 public SetNwDst(InetAddress address) {
35 type = ActionType.SET_NW_DST;
36 this.address = address;
40 * Returns the network address this action will set
44 public InetAddress getAddress() {
48 @XmlElement(name = "address")
49 public String getAddressAsString() {
50 return address.getHostAddress();
54 public boolean equals(Object obj) {
58 if (!super.equals(obj)) {
61 if (getClass() != obj.getClass()) {
64 SetNwDst other = (SetNwDst) obj;
65 if (address == null) {
66 if (other.address != null) {
69 } else if (!address.equals(other.address)) {
76 public int hashCode() {
78 int result = super.hashCode();
79 result = prime * result + ((address == null) ? 0 : address.hashCode());
84 public String toString() {
85 return type + "[address = " + address + "]";