org.apache.directory.server.dhcp.messages
Class HardwareAddress

java.lang.Object
  extended by org.apache.directory.server.dhcp.messages.HardwareAddress

public final class HardwareAddress
extends java.lang.Object

A representation of a DHCP hardware address.

Version:
$Rev: 551805 $, $Date: 2007-06-29 00:57:04 -0500 (Fr, 29 Jun 2007) $
Author:
Apache Directory Project

Constructor Summary
HardwareAddress(short type, short length, byte[] address)
           
 
Method Summary
 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().
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HardwareAddress

public HardwareAddress(short type,
                       short length,
                       byte[] address)
Parameters:
type -
length -
address -
Method Detail

getAddress

public byte[] getAddress()

getLength

public short getLength()

getType

public short getType()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the instance's hash code
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getNativeRepresentation

public java.lang.String getNativeRepresentation()
Create the string representation of the hardware address native to the corresponding address type. This method currently supports only type 1==ethernet with the representation a1:a2:a3:a4:a5:a6.
For all other types, this method falls back to the representation created by toString().

See Also:
Object.toString()

toString

public java.lang.String toString()
Create a string representation of the hardware address. The string representation is in the format
t/a1:a2:a3...
Where t represents the address type (decimal) and an represent the address bytes (hexadecimal).

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

valueOf

public static HardwareAddress valueOf(java.lang.String s)
Parses a string representation of a hardware address according to the specification given in toString().

Parameters:
s -
Returns:
HardwareAddress
Throws:
java.text.ParseException


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.