Merge "Mark AD-SAL interfaces as deprecated"
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / reader / NodeDescription.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.reader;
11
12 import java.io.Serializable;
13
14
15 /**
16  * Represents the network node description information
17  */
18 @Deprecated
19 public class NodeDescription implements Serializable, Cloneable{
20     private static final long serialVersionUID = 1L;
21
22     private String manufacturer;
23     private String hardware;
24     private String software;
25     private String serialNumber;
26     private String description;
27
28     public NodeDescription() {
29
30     }
31
32     public String getManufacturer() {
33         return manufacturer;
34     }
35
36     public void setManufacturer(String manufacturer) {
37         this.manufacturer = manufacturer;
38     }
39
40     public String getHardware() {
41         return hardware;
42     }
43
44     public void setHardware(String hardware) {
45         this.hardware = hardware;
46     }
47
48     public String getSoftware() {
49         return software;
50     }
51
52     public void setSoftware(String software) {
53         this.software = software;
54     }
55
56     public String getSerialNumber() {
57         return serialNumber;
58     }
59
60     public void setSerialNumber(String serialNumber) {
61         this.serialNumber = serialNumber;
62     }
63
64     public String getDescription() {
65         return description;
66     }
67
68     public void setDescription(String description) {
69         this.description = description;
70     }
71
72     @Override
73     public int hashCode() {
74         final int prime = 31;
75         int result = 1;
76         result = prime * result + ((description == null) ? 0 : description.hashCode());
77         result = prime * result + ((hardware == null) ? 0 : hardware.hashCode());
78         result = prime * result + ((manufacturer == null) ? 0 : manufacturer.hashCode());
79         result = prime * result + ((serialNumber == null) ? 0 : serialNumber.hashCode());
80         result = prime * result + ((software == null) ? 0 : software.hashCode());
81         return result;
82     }
83
84     @Override
85     public boolean equals(Object obj) {
86         if (this == obj) {
87             return true;
88         }
89         if (obj == null) {
90             return false;
91         }
92         if (!(obj instanceof NodeDescription)) {
93             return false;
94         }
95         NodeDescription other = (NodeDescription) obj;
96         if (description == null) {
97             if (other.description != null) {
98                 return false;
99             }
100         } else if (!description.equals(other.description)) {
101             return false;
102         }
103         if (hardware == null) {
104             if (other.hardware != null) {
105                 return false;
106             }
107         } else if (!hardware.equals(other.hardware)) {
108             return false;
109         }
110         if (manufacturer == null) {
111             if (other.manufacturer != null) {
112                 return false;
113             }
114         } else if (!manufacturer.equals(other.manufacturer)) {
115             return false;
116         }
117         if (serialNumber == null) {
118             if (other.serialNumber != null) {
119                 return false;
120             }
121         } else if (!serialNumber.equals(other.serialNumber)) {
122             return false;
123         }
124         if (software == null) {
125             if (other.software != null) {
126                 return false;
127             }
128         } else if (!software.equals(other.software)) {
129             return false;
130         }
131         return true;
132     }
133
134     @Override
135     public String toString() {
136         return "HwDescription[manufacturer=" + manufacturer + ", hardware="
137                         + hardware + ", software=" + software + ", serialNumber="
138                         + serialNumber + ", description=" + description + "]";
139     }
140     @Override
141     public NodeDescription clone() {
142         NodeDescription nd = new NodeDescription();
143         nd.setDescription(description);
144         nd.setHardware(hardware);
145         nd.setManufacturer(manufacturer);
146         nd.setSerialNumber(serialNumber);
147         nd.setSoftware(software);
148
149         return nd;
150     }
151 }