Mark AD-SAL interfaces as deprecated
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / action / SetTpSrc.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.sal.action;
10
11 import javax.xml.bind.annotation.XmlAccessType;
12 import javax.xml.bind.annotation.XmlAccessorType;
13 import javax.xml.bind.annotation.XmlElement;
14 import javax.xml.bind.annotation.XmlRootElement;
15
16 /**
17  * Set source transport port action
18  *
19  */
20 @XmlRootElement
21 @XmlAccessorType(XmlAccessType.NONE)
22 @Deprecated
23 public class SetTpSrc extends Action {
24     private static final long serialVersionUID = 1L;
25     @XmlElement
26     private int port;
27
28     /* Dummy constructor for JAXB */
29     @SuppressWarnings("unused")
30     private SetTpSrc() {
31     }
32
33     public SetTpSrc(int port) {
34         type = ActionType.SET_TP_SRC;
35         this.port = port;
36         checkValue(port);
37     }
38
39     /**
40      * Returns the transport port the action will set
41      *
42      * @return
43      */
44     public int getPort() {
45         return port;
46     }
47
48     @Override
49     public boolean equals(Object obj) {
50         if (this == obj) {
51             return true;
52         }
53         if (!super.equals(obj)) {
54             return false;
55         }
56         if (getClass() != obj.getClass()) {
57             return false;
58         }
59         SetTpSrc other = (SetTpSrc) obj;
60         if (port != other.port) {
61             return false;
62         }
63         return true;
64     }
65
66     @Override
67     public int hashCode() {
68         final int prime = 31;
69         int result = super.hashCode();
70         result = prime * result + port;
71         return result;
72     }
73
74     @Override
75     public String toString() {
76         return type + "[port = " + port + "]";
77     }
78 }