Prevent ConfigPusher from killing its thread
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / Description.java
1 package org.opendaylight.controller.sal.core;
2
3 import javax.xml.bind.annotation.XmlAccessType;
4 import javax.xml.bind.annotation.XmlAccessorType;
5 import javax.xml.bind.annotation.XmlElement;
6 import javax.xml.bind.annotation.XmlRootElement;
7
8 /**
9  * The class represents the Name property of an element.
10  */
11 @XmlRootElement
12 @SuppressWarnings("serial")
13 @XmlAccessorType(XmlAccessType.NONE)
14 public class Description extends Property {
15     @XmlElement(name="value")
16     private String descriptionValue;
17     public static final String propertyName = "description";
18
19     /*
20      * Private constructor used for JAXB mapping
21      */
22     private Description() {
23         super(propertyName);
24         this.descriptionValue = null;
25     }
26
27     public Description(String description) {
28         super(propertyName);
29         this.descriptionValue = description;
30     }
31
32     @Override
33     public Description clone() {
34         return new Description(this.descriptionValue);
35     }
36
37     public String getValue() {
38         return this.descriptionValue;
39     }
40
41     @Override
42     public int hashCode() {
43         final int prime = 31;
44         int result = super.hashCode();
45         result = prime * result
46                 + ((descriptionValue == null) ? 0 : descriptionValue.hashCode());
47         return result;
48     }
49
50     @Override
51     public boolean equals(Object obj) {
52         if (this == obj)
53             return true;
54         if (!super.equals(obj))
55             return false;
56         if (getClass() != obj.getClass())
57             return false;
58         Description other = (Description) obj;
59         if (descriptionValue == null) {
60             if (other.descriptionValue != null)
61                 return false;
62         } else if (!descriptionValue.equals(other.descriptionValue))
63             return false;
64         return true;
65     }
66
67     @Override
68     public String toString() {
69         return "Description[" + descriptionValue + "]";
70     }
71
72     @Override
73     public String getStringValue() {
74         return descriptionValue;
75     }
76 }