jain.protocol.ip.sip
Class NameAddress

java.lang.Object
  |
  +--jain.protocol.ip.sip.NameAddress

public final class NameAddress
extends java.lang.Object
implements java.lang.Cloneable

This class represents a user's display name and address. A NameAddress contains an optional display name for the user, which can be displayed to an end-user, and the URI (most likely a SipURL) that is the user's address.

Version:
0.6
See Also:
URI, SipURL

Constructor Summary
NameAddress(java.lang.String displayName, URI address)
          Creates a NameAddress based on given diaplay name and address
NameAddress(URI address)
          Creates a NameAddress based on given address
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of NameAddress
 boolean equals(NameAddress nameAddress)
          Indicates whether some other NameAddress is "equal to" this one
 URI getAddress()
          Gets address of NameAddress
 java.lang.String getDisplayName()
          Gets display name of NameAddress
 boolean hasDisplayName()
          Returns boolean value to indicate if NameAddress has a display name
 void removeDisplayName()
          Removes display name from NameAddress
 void setAddress(URI address)
          Sets address of NameAddress
 void setDisplayName(java.lang.String displayName)
          Sets display name of Header
 java.lang.String toString()
          Gets string representation of NameAddress
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameAddress

public NameAddress(URI address)
            throws java.lang.IllegalArgumentException
Creates a NameAddress based on given address
Parameters:
address - address URI
Throws:
java.lang.IllegalArgumentException - if address is null

NameAddress

public NameAddress(java.lang.String displayName,
                   URI address)
            throws java.lang.IllegalArgumentException
Creates a NameAddress based on given diaplay name and address
Parameters:
displayName - display name
address - address URI
Throws:
java.lang.IllegalArgumentException - if displayName is null or zero-length, or if address is null
Method Detail

getDisplayName

public java.lang.String getDisplayName()
                                throws ParameterNotSetException
Gets display name of NameAddress
Returns:
display name of NameAddress
Throws:
ParameterNotSetException - if display name does not exist

setDisplayName

public void setDisplayName(java.lang.String displayName)
                    throws java.lang.IllegalArgumentException
Sets display name of Header
Parameters:
displayName - display name
Throws:
java.lang.IllegalArgumentException - if displayName is null or zero-length

removeDisplayName

public void removeDisplayName()
Removes display name from NameAddress

hasDisplayName

public boolean hasDisplayName()
Returns boolean value to indicate if NameAddress has a display name
Returns:
boolean value to indicate if NameAddress has a display name

getAddress

public URI getAddress()
Gets address of NameAddress
Returns:
address of NameAddress

setAddress

public void setAddress(URI address)
                throws java.lang.IllegalArgumentException
Sets address of NameAddress
Parameters:
address - address
Throws:
java.lang.IllegalArgumentException - if address is null

toString

public java.lang.String toString()
Gets string representation of NameAddress
Overrides:
toString in class java.lang.Object
Returns:
string representation of NameAddress

clone

public java.lang.Object clone()
Creates and returns a copy of NameAddress

equals

public boolean equals(NameAddress nameAddress)
Indicates whether some other NameAddress is "equal to" this one
Parameters:
nameAddress - the NameAddress with which to compare


If you have any comments or queries, please mail them to JAIN-SIP-interest@sun.com


Copyright - 2000 Sun Microsystems