2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.openflowplugin.libraries.liblldp;
11 import java.io.Serializable;
13 import javax.xml.bind.annotation.XmlRootElement;
16 * @file DataLinkAddress.java
18 * @brief Abstract base class for a Datalink Address
23 * Abstract base class for a Datalink Address
27 abstract public class DataLinkAddress implements Serializable {
28 private static final long serialVersionUID = 1L;
31 public DataLinkAddress() {
36 * Constructor of super class
38 * @param name Create a new DataLink, not for general use but
39 * available only for sub classes
41 protected DataLinkAddress(final String name) {
46 * Used to copy the DataLinkAddress in a polymorphic way
49 * @return A clone of this DataLinkAddress
52 abstract public DataLinkAddress clone();
55 * Allow to distinguish among different data link addresses
58 * @return Name of the DataLinkAdress we are working on
60 public String getName() {
65 public int hashCode() {
68 result = prime * result + ((name == null) ? 0 : name.hashCode());
73 public boolean equals(final Object obj) {
80 if (getClass() != obj.getClass()) {
83 DataLinkAddress other = (DataLinkAddress) obj;
85 if (other.name != null) {
88 } else if (!name.equals(other.name)) {
95 public String toString() {
96 return "DataLinkAddress [name=" + name + "]";