3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
10 package org.opendaylight.controller.liblldp;
12 import java.io.Serializable;
14 import javax.xml.bind.annotation.XmlRootElement;
17 * @file DataLinkAddress.java
19 * @brief Abstract base class for a Datalink Address
24 * Abstract base class for a Datalink Address
28 abstract public class DataLinkAddress implements Serializable {
29 private static final long serialVersionUID = 1L;
32 public DataLinkAddress() {
37 * Constructor of super class
39 * @param name Create a new DataLink, not for general use but
40 * available only for sub classes
42 * @return constructed object
44 protected DataLinkAddress(String name) {
49 * Used to copy the DataLinkAddress in a polymorphic way
52 * @return A clone of this DataLinkAddress
55 abstract public DataLinkAddress clone();
58 * Allow to distinguish among different data link addresses
61 * @return Name of the DataLinkAdress we are working on
63 public String getName() {
68 public int hashCode() {
71 result = prime * result + ((name == null) ? 0 : name.hashCode());
76 public boolean equals(Object obj) {
83 if (getClass() != obj.getClass()) {
86 DataLinkAddress other = (DataLinkAddress) obj;
88 if (other.name != null) {
91 } else if (!name.equals(other.name)) {
98 public String toString() {
99 return "DataLinkAddress [name=" + name + "]";