public final class HardwareAddress
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
address
[chaddr] Client hardware address.
|
private short |
length
[hlen] Hardware address length (e.g.
|
private static java.util.regex.Pattern |
PARSE_PATTERN |
private short |
type
[htype] Hardware address type, see ARP section in "Assigned Numbers" RFC;
e.g., '1' = 10mb ethernet.
|
| Constructor and Description |
|---|
HardwareAddress(short type,
short length,
byte[] address) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
byte[] |
getAddress() |
short |
getLength() |
java.lang.String |
getNativeRepresentation()
Create the string representation of the hardware address native to the
corresponding address type.
|
short |
getType() |
int |
hashCode() |
java.lang.String |
toString()
Create a string representation of the hardware address.
|
static HardwareAddress |
valueOf(java.lang.String s)
Parses a string representation of a hardware address according to the
specification given in
toString(). |
private final short type
private final short length
private final byte[] address
private static final java.util.regex.Pattern PARSE_PATTERN
public HardwareAddress(short type,
short length,
byte[] address)
type - length - address - public byte[] getAddress()
public short getLength()
public short getType()
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String getNativeRepresentation()
a1:a2:a3:a4:a5:a6.Object.toString()public java.lang.String toString()
t/a1:a2:a3...t represents the address type (decimal) and
an represent the address bytes (hexadecimal).toString in class java.lang.ObjectObject.toString()public static HardwareAddress valueOf(java.lang.String s)
toString().s - ParseException