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.sal.packet.address;
12 import java.io.Serializable;
14 import javax.xml.bind.annotation.XmlRootElement;
15 import javax.xml.bind.annotation.XmlSeeAlso;
17 import org.apache.commons.lang3.builder.HashCodeBuilder;
18 import org.apache.commons.lang3.builder.EqualsBuilder;
19 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
22 * @file DataLinkAddress.java
24 * @brief Abstract base class for a Datalink Address
29 * Abstract base class for a Datalink Address
33 @XmlSeeAlso( { EthernetAddress.class })
34 abstract public class DataLinkAddress implements Serializable {
35 private static final long serialVersionUID = 1L;
38 public DataLinkAddress() {
43 * Constructor of super class
45 * @param name Create a new DataLink, not for general use but
46 * available only for sub classes
48 * @return constructed object
50 protected DataLinkAddress(String name) {
55 * Used to copy the DataLinkAddress in a polymorphic way
58 * @return A clone of this DataLinkAddress
60 abstract public DataLinkAddress clone();
63 * Allow to distinguish among different data link addresses
66 * @return Name of the DataLinkAdress we are working on
68 public String getName() {
73 public int hashCode() {
74 return HashCodeBuilder.reflectionHashCode(this);
78 public boolean equals(Object obj) {
79 return EqualsBuilder.reflectionEquals(this, obj);
83 public String toString() {
84 return "DataLinkAddress[" + ReflectionToStringBuilder.toString(this)