Make sure invokeOperation is set once
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / core / Description.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.sal.core;
9
10 import javax.xml.bind.annotation.XmlAccessType;
11 import javax.xml.bind.annotation.XmlAccessorType;
12 import javax.xml.bind.annotation.XmlElement;
13 import javax.xml.bind.annotation.XmlRootElement;
14
15 /**
16  * The class represents the Name property of an element.
17  */
18 @XmlRootElement
19 @SuppressWarnings("serial")
20 @XmlAccessorType(XmlAccessType.NONE)
21 @Deprecated
22 public class Description extends Property {
23     @XmlElement(name="value")
24     private String descriptionValue;
25     public static final String propertyName = "description";
26
27     /*
28      * Private constructor used for JAXB mapping
29      */
30     private Description() {
31         super(propertyName);
32         this.descriptionValue = null;
33     }
34
35     public Description(String description) {
36         super(propertyName);
37         this.descriptionValue = description;
38     }
39
40     @Override
41     public Description clone() {
42         return new Description(this.descriptionValue);
43     }
44
45     public String getValue() {
46         return this.descriptionValue;
47     }
48
49     @Override
50     public int hashCode() {
51         final int prime = 31;
52         int result = super.hashCode();
53         result = prime * result
54                 + ((descriptionValue == null) ? 0 : descriptionValue.hashCode());
55         return result;
56     }
57
58     @Override
59     public boolean equals(Object obj) {
60         if (this == obj)
61             return true;
62         if (!super.equals(obj))
63             return false;
64         if (getClass() != obj.getClass())
65             return false;
66         Description other = (Description) obj;
67         if (descriptionValue == null) {
68             if (other.descriptionValue != null)
69                 return false;
70         } else if (!descriptionValue.equals(other.descriptionValue))
71             return false;
72         return true;
73     }
74
75     @Override
76     public String toString() {
77         return "Description[" + descriptionValue + "]";
78     }
79
80     @Override
81     public String getStringValue() {
82         return descriptionValue;
83     }
84 }