Revert "Checkstyle enforcer"
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / action / SetVlanPcp.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.opendaylight.controller.sal.action;
11
12 import javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 /**
18  * Set vlan PCP action
19  */
20 @XmlRootElement
21 @XmlAccessorType(XmlAccessType.NONE)
22
23 public class SetVlanPcp extends Action {
24         @XmlElement
25     private int pcp;
26
27         private SetVlanPcp() {
28                 
29         }
30         
31     public SetVlanPcp(int pcp) {
32         type = ActionType.SET_VLAN_PCP;
33         this.pcp = pcp;
34         checkValue(pcp);
35     }
36
37     /**
38      * Returns the value of the vlan PCP this action will set
39      * @return int
40      */
41     public int getPcp() {
42         return pcp;
43     }
44
45     @Override
46     public boolean equals(Object obj) {
47         if (this == obj)
48             return true;
49         if (!super.equals(obj))
50             return false;
51         if (getClass() != obj.getClass())
52             return false;
53         SetVlanPcp other = (SetVlanPcp) obj;
54         if (pcp != other.pcp)
55             return false;
56         return true;
57     }
58
59     @Override
60     public int hashCode() {
61         final int prime = 31;
62         int result = super.hashCode();
63         result = prime * result + pcp;
64         return result;
65     }
66
67     @Override
68     public String toString() {
69         return type + "[pcp = " + Integer.toHexString(pcp) + "]";
70     }
71 }