Fix to remove camel case for Northbound API
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / Buffers.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  * @file   Buffers.java
17  *
18  * @brief  Class representing buffers
19  *
20  * Describes supported buffers (#packets)
21  */
22 @XmlRootElement
23 public class Buffers extends Property {
24         private static final long serialVersionUID = 1L;
25     @XmlElement(name="value")
26     private int buffersValue;
27
28     public static final String BuffersPropName = "buffers";
29
30     /**
31      * Construct a Buffers property
32      *
33      * @param buffers the Buffers
34      * @return Constructed object
35      */
36     public Buffers(int buffers) {
37         super(BuffersPropName);
38         this.buffersValue = buffers;
39     }
40
41     /*
42      * Private constructor used for JAXB mapping
43      */
44     private Buffers() {
45         super(BuffersPropName);
46         this.buffersValue = 0;
47     }
48
49     @Override
50     public Buffers clone() {
51         return new Buffers(this.buffersValue);
52     }
53
54     public int getValue() {
55         return this.buffersValue;
56     }
57
58     @Override
59     public int hashCode() {
60         final int prime = 31;
61         int result = super.hashCode();
62         result = prime * result + buffersValue;
63         return result;
64     }
65
66     @Override
67     public boolean equals(Object obj) {
68         if (this == obj)
69             return true;
70         if (!super.equals(obj))
71             return false;
72         if (getClass() != obj.getClass())
73             return false;
74         Buffers other = (Buffers) obj;
75         if (buffersValue != other.buffersValue)
76             return false;
77         return true;
78     }
79
80     @Override
81     public String toString() {
82         return "Buffers[" + buffersValue + "]";
83     }
84 }