Fix to remove camel case for Northbound API
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / Tier.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.core;
11
12 import javax.xml.bind.annotation.XmlElement;
13 import javax.xml.bind.annotation.XmlRootElement;
14
15 /**
16  * The class represents the Tier property of a node
17  *
18  *
19  */
20 @XmlRootElement
21 @SuppressWarnings("serial")
22 public class Tier extends Property {
23     @XmlElement(name="value")
24     private int tierValue;
25     public static final String TierPropName = "tier";
26
27     public Tier(int tier) {
28         super(TierPropName);
29         this.tierValue = tier;
30     }
31
32     /*
33      * Private constructor used for JAXB mapping
34      */
35     private Tier() {
36         super(TierPropName);
37         this.tierValue = 0;
38     }
39
40     @Override
41     public Tier clone() {
42         return new Tier(this.tierValue);
43     }
44
45     public int getValue() {
46         return this.tierValue;
47     }
48
49     @Override
50     public int hashCode() {
51         final int prime = 31;
52         int result = super.hashCode();
53         result = prime * result + tierValue;
54         return result;
55     }
56
57     @Override
58     public boolean equals(Object obj) {
59         if (this == obj)
60             return true;
61         if (!super.equals(obj))
62             return false;
63         if (getClass() != obj.getClass())
64             return false;
65         Tier other = (Tier) obj;
66         if (tierValue != other.tierValue)
67             return false;
68         return true;
69     }
70
71     @Override
72     public String toString() {
73         return "Tier[" + tierValue + "]";
74     }
75 }