Remove the usages of @XmlSeeAlso annotation.
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / packet / address / DataLinkAddress.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.packet.address;
11
12 import java.io.Serializable;
13
14 import javax.xml.bind.annotation.XmlRootElement;
15 import javax.xml.bind.annotation.XmlSeeAlso;
16
17 /**
18  * @file   DataLinkAddress.java
19  *
20  * @brief  Abstract base class for a Datalink Address
21  *
22  */
23
24 /**
25  * Abstract base class for a Datalink Address
26  *
27  */
28 @XmlRootElement
29 abstract public class DataLinkAddress implements Serializable {
30     private static final long serialVersionUID = 1L;
31     private String name;
32
33     public DataLinkAddress() {
34
35     }
36
37     /**
38      * Constructor of super class
39      *
40      * @param name Create a new DataLink, not for general use but
41      * available only for sub classes
42      *
43      * @return constructed object
44      */
45     protected DataLinkAddress(String name) {
46         this.name = name;
47     }
48
49     /**
50      * Used to copy the DataLinkAddress in a polymorphic way
51      *
52      *
53      * @return A clone of this DataLinkAddress
54      */
55     @Override
56     abstract public DataLinkAddress clone();
57
58     /**
59      * Allow to distinguish among different data link addresses
60      *
61      *
62      * @return Name of the DataLinkAdress we are working on
63      */
64     public String getName() {
65         return this.name;
66     }
67
68     @Override
69     public int hashCode() {
70         final int prime = 31;
71         int result = 1;
72         result = prime * result + ((name == null) ? 0 : name.hashCode());
73         return result;
74     }
75
76     @Override
77     public boolean equals(Object obj) {
78         if (this == obj)
79             return true;
80         if (obj == null)
81             return false;
82         if (getClass() != obj.getClass())
83             return false;
84         DataLinkAddress other = (DataLinkAddress) obj;
85         if (name == null) {
86             if (other.name != null)
87                 return false;
88         } else if (!name.equals(other.name))
89             return false;
90         return true;
91     }
92
93     @Override
94     public String toString() {
95         return "DataLinkAddress [name=" + name + "]";
96     }
97 }