Mark AD-SAL interfaces as deprecated
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / action / SetVlanCfi.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 CFI action
18  *
19  */
20 @XmlRootElement
21 @XmlAccessorType(XmlAccessType.NONE)
22 @Deprecated
23 public class SetVlanCfi extends Action {
24     private static final long serialVersionUID = 1L;
25     @XmlElement
26     private int cfi;
27
28     /* Dummy constructor for JAXB */
29     @SuppressWarnings("unused")
30     private SetVlanCfi() {
31     }
32
33     public SetVlanCfi(int cfi) {
34         type = ActionType.SET_VLAN_CFI;
35         this.cfi = cfi;
36         checkValue(cfi);
37     }
38
39     /**
40      * Returns the 802.1q CFI value that this action will set
41      *
42      * @return
43      */
44     public int getCfi() {
45         return cfi;
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         SetVlanCfi other = (SetVlanCfi) obj;
60         if (cfi != other.cfi) {
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 + cfi;
71         return result;
72     }
73
74     @Override
75     public String toString() {
76         return type + "[cfi = " + Integer.toHexString(cfi) + "]";
77     }
78 }