-
/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
public static final String addressName = "Ethernet MAC Address";
public static final int SIZE = 6;
- private static final EthernetAddress createWellKnownAddress(byte[] mac) {
+ private static final EthernetAddress createWellKnownAddress(final byte[] mac) {
try {
return new EthernetAddress(mac);
- } catch (ConstructionException ce) {
+ } catch (final ConstructionException ce) {
return null;
}
}
*
* @param macAddress A byte array in big endian format
* representing the Ethernet MAC Address
- *
- * @return The constructed object if valid
*/
- public EthernetAddress(byte[] macAddress) throws ConstructionException {
+ public EthernetAddress(final byte[] macAddress) throws ConstructionException {
super(addressName);
if (macAddress == null) {
public EthernetAddress clone() {
try {
return new EthernetAddress(this.macAddress.clone());
- } catch (ConstructionException ce) {
+ } catch (final ConstructionException ce) {
return null;
}
}
}
@Override
- public boolean equals(Object obj) {
- if (this == obj)
+ public boolean equals(final Object obj) {
+ if (this == obj) {
return true;
- if (!super.equals(obj))
+ }
+ if (!super.equals(obj)) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
EthernetAddress other = (EthernetAddress) obj;
- if (!Arrays.equals(macAddress, other.macAddress))
+ if (!Arrays.equals(macAddress, other.macAddress)) {
return false;
+ }
return true;
}