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