Mark AD-SAL interfaces as deprecated
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / core / Name.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.core;
11
12 import javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 /**
18  * The class represents the Name property of an element.
19  */
20 @XmlRootElement
21 @XmlAccessorType(XmlAccessType.NONE)
22 @SuppressWarnings("serial")
23 @Deprecated
24 public class Name extends Property {
25     @XmlElement(name="value")
26     private String nameValue;
27     public static final String NamePropName = "name";
28
29     /*
30      * Private constructor used for JAXB mapping
31      */
32     private Name() {
33         super(NamePropName);
34         this.nameValue = null;
35     }
36
37     public Name(String name) {
38         super(NamePropName);
39         this.nameValue = name;
40     }
41
42     @Override
43     public Name clone() {
44         return new Name(this.nameValue);
45     }
46
47     public String getValue() {
48         return this.nameValue;
49     }
50
51     @Override
52     public int hashCode() {
53         final int prime = 31;
54         int result = super.hashCode();
55         result = prime * result
56                 + ((nameValue == null) ? 0 : nameValue.hashCode());
57         return result;
58     }
59
60     @Override
61     public boolean equals(Object obj) {
62         if (this == obj)
63             return true;
64         if (!super.equals(obj))
65             return false;
66         if (getClass() != obj.getClass())
67             return false;
68         Name other = (Name) obj;
69         if (nameValue == null) {
70             if (other.nameValue != null)
71                 return false;
72         } else if (!nameValue.equals(other.nameValue))
73             return false;
74         return true;
75     }
76
77     @Override
78     public String toString() {
79         return "Name[" + nameValue + "]";
80     }
81
82     @Override
83     public String getStringValue() {
84         return nameValue;
85     }
86 }