Make sure invokeOperation is set once
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / action / SetVlanId.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 vlan id action
18  */
19
20 @XmlRootElement
21 @XmlAccessorType(XmlAccessType.NONE)
22 @Deprecated
23 public class SetVlanId extends Action {
24     private static final long serialVersionUID = 1L;
25     @XmlElement
26     private int vlanId;
27
28     @SuppressWarnings("unused")
29     private SetVlanId() {
30
31     }
32
33     public SetVlanId(int vlanId) {
34         type = ActionType.SET_VLAN_ID;
35         this.vlanId = vlanId;
36         checkValue(vlanId);
37     }
38
39     /**
40      * Returns the vlan id this action will set
41      *
42      * @return int
43      */
44     public int getVlanId() {
45         return vlanId;
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         SetVlanId other = (SetVlanId) obj;
60         if (vlanId != other.vlanId) {
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 + vlanId;
71         return result;
72     }
73
74     @Override
75     public String toString() {
76         return type + "[vlanId = " + vlanId + "]";
77     }
78 }