Remove the usages of @XmlSeeAlso annotation.
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / Property.java
1 /*
2  * Copyright (c) 2013 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
9 package org.opendaylight.controller.sal.core;
10
11 import java.io.Serializable;
12
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlRootElement;
16 import javax.xml.bind.annotation.XmlSeeAlso;
17
18 /**
19  * @file   Property.java
20  *
21  * @brief  Abstract base class for a Property that can be attached to
22  * any sal core element
23  *
24  * Abstract base class for a Property that can be attached to any sal
25  * core element
26  */
27
28 /**
29  * Abstract base class for a Property that can be attached to any sal core
30  * element
31  */
32 @XmlRootElement
33 @XmlAccessorType(XmlAccessType.NONE)
34 abstract public class Property implements Serializable, Cloneable {
35     private static final long serialVersionUID = 1L;
36     private final String name;
37
38     /**
39      * Private constructor used for JAXB mapping
40      */
41     @SuppressWarnings("unused")
42     private Property() {
43         this.name = null;
44     }
45
46     protected Property(String name) {
47         this.name = name;
48     }
49
50     public String getName() {
51         return this.name;
52     }
53
54     public abstract String getStringValue();
55
56     /**
57      * Used to copy the Property in a polymorphic way
58      *
59      * @return A clone of this Property
60      */
61     @Override
62     public abstract Property clone();
63
64     @Override
65     public int hashCode() {
66         final int prime = 31;
67         int result = 1;
68         result = prime * result + ((name == null) ? 0 : name.hashCode());
69         return result;
70     }
71
72     @Override
73     public boolean equals(Object obj) {
74         if (this == obj) {
75             return true;
76         }
77         if (obj == null) {
78             return false;
79         }
80         if (getClass() != obj.getClass()) {
81             return false;
82         }
83         Property other = (Property) obj;
84         if (name == null) {
85             if (other.name != null) {
86                 return false;
87             }
88         } else if (!name.equals(other.name)) {
89             return false;
90         }
91         return true;
92     }
93
94     @Override
95     public String toString() {
96         return "Property [name=" + name + "]";
97     }
98 }