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