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