public class EthernetAddress
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Constructor and Description |
---|
EthernetAddress(byte[] ethernetAddress)
Create a EthernetAddress based on the provided bytes.
|
EthernetAddress(java.lang.String ethernetAddress)
Create a EthernetAddress based on the provided address.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
byteToHexString(byte b) |
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
protected byte[] |
parseEthernetAddress(java.lang.String ethernetAddress)
Parses a String representing an ethernet address into an byte array.
|
byte[] |
toBytes()
Returns the byte representation of this ethernet address.
|
java.lang.String |
toString() |
public EthernetAddress(java.lang.String ethernetAddress) throws IllegalEthernetAddressException
ethernetAddress
- the ethernet addressjava.lang.IllegalArgumentException
- if the ethernet address could not be parsedjava.lang.NullPointerException
- if the ethernet address is nullIllegalEthernetAddressException
public EthernetAddress(byte[] ethernetAddress) throws IllegalEthernetAddressException
ethernetAddress
- the bytes. Must have length of 6!IllegalEthernetAddressException
- if ethernet address is of illegal length or nulljava.lang.NullPointerException
- if the ethernet address is nullprotected byte[] parseEthernetAddress(java.lang.String ethernetAddress) throws IllegalEthernetAddressException
ethernetAddress
- a String representation of the ethernet address.IllegalEthernetAddressException
public byte[] toBytes()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String byteToHexString(byte b)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object