3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
10 package org.opendaylight.controller.sal.reader;
12 import java.io.Serializable;
16 * Represents the network node description information
18 public class NodeDescription implements Serializable, Cloneable{
19 private static final long serialVersionUID = 1L;
21 private String manufacturer;
22 private String hardware;
23 private String software;
24 private String serialNumber;
25 private String description;
27 public NodeDescription() {
31 public String getManufacturer() {
35 public void setManufacturer(String manufacturer) {
36 this.manufacturer = manufacturer;
39 public String getHardware() {
43 public void setHardware(String hardware) {
44 this.hardware = hardware;
47 public String getSoftware() {
51 public void setSoftware(String software) {
52 this.software = software;
55 public String getSerialNumber() {
59 public void setSerialNumber(String serialNumber) {
60 this.serialNumber = serialNumber;
63 public String getDescription() {
67 public void setDescription(String description) {
68 this.description = description;
72 public int hashCode() {
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());
84 public boolean equals(Object obj) {
91 if (!(obj instanceof NodeDescription)) {
94 NodeDescription other = (NodeDescription) obj;
95 if (description == null) {
96 if (other.description != null) {
99 } else if (!description.equals(other.description)) {
102 if (hardware == null) {
103 if (other.hardware != null) {
106 } else if (!hardware.equals(other.hardware)) {
109 if (manufacturer == null) {
110 if (other.manufacturer != null) {
113 } else if (!manufacturer.equals(other.manufacturer)) {
116 if (serialNumber == null) {
117 if (other.serialNumber != null) {
120 } else if (!serialNumber.equals(other.serialNumber)) {
123 if (software == null) {
124 if (other.software != null) {
127 } else if (!software.equals(other.software)) {
134 public String toString() {
135 return "HwDescription[manufacturer=" + manufacturer + ", hardware="
136 + hardware + ", software=" + software + ", serialNumber="
137 + serialNumber + ", description=" + description + "]";
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);